:root {
  --ink: #1d1d1f;
  --paper: #fff7df;
  --panel: #fffdf6;
  --line: #202020;
  --red: #f24c3d;
  --blue: #2b7fff;
  --yellow: #ffd34f;
  --green: #48b86f;
  --shadow: rgba(29, 29, 31, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  background:
    radial-gradient(circle at 20% 10%, rgba(255, 211, 79, 0.35), transparent 28rem),
    linear-gradient(135deg, #fdf0b8 0%, #ffe0c8 48%, #cfeaff 100%);
  min-height: 100vh;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  max-width: 1180px;
  margin: 0 auto;
  padding: 2rem 1rem 1rem;
}

.episode-label {
  display: inline-block;
  margin: 0 0 0.45rem;
  padding: 0.35rem 0.65rem;
  border: 3px solid var(--line);
  border-radius: 999px;
  background: var(--yellow);
  font-weight: 800;
  box-shadow: 3px 3px 0 var(--line);
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 6vw, 4.8rem);
  line-height: 1;
  letter-spacing: 0;
  text-shadow: 4px 4px 0 rgba(255, 255, 255, 0.85);
}

.subtitle {
  margin: 0.75rem 0 0;
  font-size: clamp(1.1rem, 2.5vw, 1.8rem);
  font-weight: 800;
}

.episode-badge {
  flex: 0 0 auto;
  padding: 1rem 1.1rem;
  border: 4px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 6px 6px 0 var(--line);
  font-weight: 900;
  transform: rotate(3deg);
}

main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1rem 2rem;
}

.reader-toolbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1rem 0;
  padding: 0.8rem;
  border: 4px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 246, 0.94);
  box-shadow: 0 12px 22px var(--shadow);
  backdrop-filter: blur(8px);
}

.comic-button {
  min-height: 2.7rem;
  padding: 0.65rem 1rem;
  border: 3px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--yellow);
  box-shadow: 3px 3px 0 var(--line);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.comic-button:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--line);
}

.comic-button:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--line);
}

.comic-button.ghost {
  background: #ffffff;
}

#panelCounter {
  min-width: 7rem;
  margin: 0;
  font-weight: 900;
  text-align: center;
}

.comic-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 0.85rem;
}

.episode-grid {
  display: none;
}

.episode-grid.active {
  display: grid;
}

.comic-grid.focus-mode {
  grid-template-columns: minmax(0, 1fr);
}

.comic-panel {
  display: block;
  border: 5px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 8px 8px 0 var(--line);
  overflow: hidden;
}

.comic-grid.focus-mode .comic-panel {
  display: none;
}

.comic-grid.focus-mode .comic-panel.active {
  display: block;
}

.panel-scene {
  position: relative;
  min-height: 285px;
  overflow: hidden;
  border-bottom: 4px solid var(--line);
  background:
    linear-gradient(transparent 66%, rgba(0, 0, 0, 0.08) 67%),
    linear-gradient(140deg, #e9f6ff 0%, #fff5bf 100%);
}

.panel-scene::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(0, 0, 0, 0.08) 1px, transparent 1px);
  background-size: 12px 12px;
  mix-blend-mode: multiply;
  opacity: 0.5;
}

.panel-scene.road,
.panel-scene.crossroad {
  background:
    linear-gradient(transparent 66%, rgba(65, 85, 60, 0.18) 67%),
    linear-gradient(145deg, #dff4ff, #f7f0c4);
}

.panel-scene.bakery {
  background:
    linear-gradient(transparent 66%, rgba(130, 88, 45, 0.18) 67%),
    linear-gradient(145deg, #fff0c7, #ffd6b8);
}

.panel-scene.training-yard {
  background:
    linear-gradient(transparent 66%, rgba(70, 70, 70, 0.18) 67%),
    linear-gradient(145deg, #dce9f4, #dff5df);
}

.panel-scene.restaurant-street {
  background:
    linear-gradient(transparent 64%, rgba(82, 72, 56, 0.2) 65%),
    linear-gradient(145deg, #fff2d0, #e6f5ff);
}

.panel-scene.restaurant-inside {
  background:
    linear-gradient(transparent 65%, rgba(167, 117, 62, 0.25) 66%),
    linear-gradient(145deg, #fff9e8, #ffe1c4);
}

.panel-scene.market-booth {
  background:
    linear-gradient(transparent 66%, rgba(88, 108, 92, 0.22) 67%),
    linear-gradient(145deg, #e8fff4, #e9f0ff);
}

.panel-scene.back-alley {
  background:
    linear-gradient(transparent 66%, rgba(70, 78, 70, 0.22) 67%),
    linear-gradient(145deg, #dcebdd, #eef5ff);
}

.panel-scene.tense-scene {
  background:
    linear-gradient(transparent 66%, rgba(38, 41, 45, 0.34) 67%),
    linear-gradient(145deg, #d7f0df, #cfd5df);
}

.panel-scene.black-ending {
  display: grid;
  place-items: center;
  background: #050505;
}

.panel-scene.game-portal {
  background:
    radial-gradient(circle at 50% 46%, rgba(83, 127, 255, 0.38), transparent 28%),
    linear-gradient(transparent 66%, rgba(55, 65, 88, 0.28) 67%),
    linear-gradient(145deg, #e9f2ff, #f2ebff);
}

.panel-scene.weapon-room {
  background:
    linear-gradient(transparent 66%, rgba(45, 52, 68, 0.32) 67%),
    linear-gradient(145deg, #dce7f8, #edf4ff);
}

.panel-scene.game-hall {
  background:
    linear-gradient(transparent 66%, rgba(50, 58, 76, 0.3) 67%),
    linear-gradient(145deg, #e7edf8, #dff7ef);
}

.character {
  position: absolute;
  z-index: 2;
  width: min(42%, 230px);
  aspect-ratio: 1;
  overflow: hidden;
  border: 7px solid #151515;
  border-radius: 50%;
  background: #ffffff;
  box-shadow:
    inset -12px -18px 0 rgba(0, 0, 0, 0.12),
    0 13px 0 rgba(0, 0, 0, 0.12);
}

.character-img {
  position: absolute;
  z-index: 2;
  width: min(42%, 230px);
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 13px 0 rgba(0, 0, 0, 0.12));
}

.character::before {
  content: "";
  position: absolute;
  inset: -2%;
}

.eye {
  position: absolute;
  z-index: 3;
  top: 35%;
  width: 18%;
  aspect-ratio: 1;
  border: 0;
  border-radius: 50%;
  background: #ffffff;
}

.eye-left {
  left: 28%;
}

.eye-right {
  right: 28%;
}

.eyes-happy .eye {
  top: 38%;
  height: 9%;
  border-radius: 999px 999px 0 0;
}

.eyes-angry .eye {
  top: 34%;
  height: 9%;
  border-radius: 0 0 999px 999px;
}

.eyes-worried .eye {
  top: 34%;
}

.eyes-focused .eye {
  top: 38%;
  height: 12%;
  border-radius: 50% 50% 42% 42%;
}

.eyes-cool .eye {
  top: 39%;
  height: 11%;
  border-radius: 999px;
}

.germany::before {
  background: linear-gradient(
    to bottom,
    #111111 0 33.33%,
    #dd1f26 33.33% 66.66%,
    #ffd31f 66.66% 100%
  );
}

.usa::before {
  background:
    radial-gradient(circle at 8% 8%, #ffffff 0 1.3%, transparent 1.6%),
    radial-gradient(circle at 18% 8%, #ffffff 0 1.3%, transparent 1.6%),
    radial-gradient(circle at 28% 8%, #ffffff 0 1.3%, transparent 1.6%),
    radial-gradient(circle at 38% 8%, #ffffff 0 1.3%, transparent 1.6%),
    radial-gradient(circle at 13% 18%, #ffffff 0 1.3%, transparent 1.6%),
    radial-gradient(circle at 23% 18%, #ffffff 0 1.3%, transparent 1.6%),
    radial-gradient(circle at 33% 18%, #ffffff 0 1.3%, transparent 1.6%),
    radial-gradient(circle at 8% 28%, #ffffff 0 1.3%, transparent 1.6%),
    radial-gradient(circle at 18% 28%, #ffffff 0 1.3%, transparent 1.6%),
    radial-gradient(circle at 28% 28%, #ffffff 0 1.3%, transparent 1.6%),
    radial-gradient(circle at 38% 28%, #ffffff 0 1.3%, transparent 1.6%),
    radial-gradient(circle at 13% 38%, #ffffff 0 1.3%, transparent 1.6%),
    radial-gradient(circle at 23% 38%, #ffffff 0 1.3%, transparent 1.6%),
    radial-gradient(circle at 33% 38%, #ffffff 0 1.3%, transparent 1.6%),
    linear-gradient(#3c3b6e 0 0) left top / 46% 53.85% no-repeat,
    repeating-linear-gradient(
      to bottom,
      #b22234 0 7.69%,
      #ffffff 7.69% 15.38%
    );
}

.character.usa {
  background: repeating-linear-gradient(
    to bottom,
    #b22234 0 7.69%,
    #ffffff 7.69% 15.38%
  );
}

.france::before {
  background: linear-gradient(
    to right,
    #24468f 0 33.33%,
    #ffffff 33.33% 66.66%,
    #e33d44 66.66% 100%
  );
}

.australia::before {
  background:
    radial-gradient(circle at 76% 30%, #ffffff 0 4%, transparent 4.6%),
    radial-gradient(circle at 76% 30%, #d92f3a 0 6.6%, transparent 7.2%),
    radial-gradient(circle at 64% 62%, #ffffff 0 3.3%, transparent 3.9%),
    radial-gradient(circle at 64% 62%, #d92f3a 0 5.5%, transparent 6.1%),
    radial-gradient(circle at 84% 66%, #ffffff 0 3.3%, transparent 3.9%),
    radial-gradient(circle at 84% 66%, #d92f3a 0 5.5%, transparent 6.1%),
    radial-gradient(circle at 73% 82%, #ffffff 0 2.8%, transparent 3.4%),
    radial-gradient(circle at 73% 82%, #d92f3a 0 4.8%, transparent 5.4%),
    linear-gradient(32deg, transparent 0 16%, #ffffff 16% 21%, #d92f3a 21% 25%, #ffffff 25% 30%, transparent 30% 100%) left top / 48% 48% no-repeat,
    linear-gradient(148deg, transparent 0 16%, #ffffff 16% 21%, #d92f3a 21% 25%, #ffffff 25% 30%, transparent 30% 100%) left top / 48% 48% no-repeat,
    linear-gradient(to bottom, transparent 0 19%, #ffffff 19% 31%, #d92f3a 31% 38%, #ffffff 38% 50%, transparent 50% 100%) left top / 48% 48% no-repeat,
    linear-gradient(to right, transparent 0 20%, #ffffff 20% 32%, #d92f3a 32% 39%, #ffffff 39% 51%, transparent 51% 100%) left top / 48% 48% no-repeat,
    #012169;
}

.australia .nothing {
  display: none;
}

.character.main {
  width: min(54%, 310px);
}

.character-img.main {
  width: min(54%, 310px);
}

.character.small {
  width: min(34%, 190px);
}

.character-img.small {
  width: min(34%, 190px);
}

.character.tiny {
  width: min(22%, 118px);
}

.character-img.tiny {
  width: min(22%, 118px);
}

.left {
  left: 5%;
  bottom: 5%;
}

.right {
  right: 4%;
  bottom: 4%;
}

.center {
  left: 34%;
  bottom: 4%;
}

.far-right {
  right: -2%;
  bottom: 4%;
}

.zombie-state {
  filter:
    hue-rotate(75deg)
    saturate(0.85)
    drop-shadow(0 8px 0 rgba(0, 0, 0, 0.1))
    drop-shadow(0 0 12px rgba(95, 215, 111, 0.5));
}

.flattened {
  width: min(48%, 280px);
  bottom: 8%;
  transform: scaleY(0.23) scaleX(1.22);
  filter: drop-shadow(0 8px 0 rgba(255, 255, 255, 0.12));
}

.sleepy {
  transform: rotate(-4deg) scale(0.9);
}

.bounce {
  transform: rotate(4deg);
}

.tilt {
  transform: rotate(-8deg);
}

.jump {
  bottom: 12%;
  animation: hop 1.2s ease-in-out infinite;
}

.comic-bubble {
  position: absolute;
  z-index: 8;
  max-width: 56%;
  padding: 0.6rem 0.75rem;
  border: 4px solid #111111;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.18);
  font-weight: 900;
  line-height: 1.25;
}

.comic-bubble::after {
  content: "";
  position: absolute;
  bottom: -14px;
  left: 28px;
  width: 22px;
  height: 22px;
  border-right: 4px solid #111111;
  border-bottom: 4px solid #111111;
  background: #ffffff;
  transform: rotate(45deg);
}

.comic-bubble.top-right::after,
.comic-bubble.bottom-right::after {
  right: 28px;
  left: auto;
}

.comic-bubble.tail-left::after {
  left: 22px;
  right: auto;
}

.comic-bubble.tail-center::after {
  left: 50%;
  right: auto;
  transform: translateX(-50%) rotate(45deg);
}

.comic-bubble.tail-right::after {
  left: auto;
  right: 22px;
}

.top-left {
  top: 7%;
  left: 6%;
}

.top-right {
  top: 7%;
  right: 6%;
}

.bottom-right {
  right: 7%;
  bottom: 11%;
}

.small-bubble {
  max-width: 38%;
}

.weird {
  background:
    linear-gradient(transparent 68%, rgba(0, 0, 0, 0.08) 69%),
    radial-gradient(circle at 50% 15%, #ffffff 0 16%, transparent 17%),
    linear-gradient(145deg, #f0f4ff, #fff0c2);
}

.finale {
  background:
    linear-gradient(transparent 68%, rgba(0, 0, 0, 0.08) 69%),
    linear-gradient(145deg, #fff7d1, #dff8e8);
}

.signpost,
.training-gate {
  position: absolute;
  z-index: 3;
  display: grid;
  place-items: center;
  border: 4px solid var(--line);
  background: #fffdf4;
  box-shadow: 5px 5px 0 var(--line);
  font-weight: 900;
}

.signpost {
  right: 9%;
  bottom: 31%;
  width: 9rem;
  min-height: 4rem;
  border-radius: 6px;
  transform: rotate(2deg);
}

.signpost::after,
.training-gate::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: 0.85rem;
  height: 5.5rem;
  border: 4px solid var(--line);
  border-top: 0;
  background: #9b6a3a;
  transform: translateX(-50%);
}

.close-sign {
  right: 47%;
  bottom: 35%;
  width: 7rem;
}

.baguette {
  position: absolute;
  right: 18%;
  bottom: 38%;
  z-index: 5;
  width: 4rem;
  height: 13rem;
  border: 4px solid #8a5526;
  border-radius: 999px;
  background:
    radial-gradient(ellipse at 50% 18%, rgba(255, 236, 179, 0.9) 0 13%, transparent 14%),
    radial-gradient(ellipse at 50% 38%, rgba(255, 236, 179, 0.9) 0 13%, transparent 14%),
    radial-gradient(ellipse at 50% 58%, rgba(255, 236, 179, 0.9) 0 13%, transparent 14%),
    linear-gradient(90deg, #b97832, #e4a84c 45%, #b97832);
  transform: rotate(-18deg);
  box-shadow: 4px 5px 0 rgba(0, 0, 0, 0.18);
}

.phone-map,
.map-card {
  position: absolute;
  z-index: 5;
  border: 4px solid var(--line);
  background: #ffffff;
  box-shadow: 5px 5px 0 var(--line);
}

.phone-map {
  right: 14%;
  bottom: 16%;
  width: 5rem;
  height: 7rem;
  border-radius: 14px;
  background:
    linear-gradient(130deg, transparent 0 38%, #48b86f 39% 44%, transparent 45%),
    radial-gradient(circle at 60% 48%, #f24c3d 0 8%, transparent 9%),
    #eaf7ff;
}

.map-card {
  right: 13%;
  bottom: 22%;
  width: 8rem;
  height: 5.4rem;
  border-radius: 8px;
  background:
    linear-gradient(145deg, transparent 0 48%, #2b7fff 49% 54%, transparent 55%),
    linear-gradient(40deg, transparent 0 42%, #48b86f 43% 49%, transparent 50%),
    #fffdf4;
}

.upside-down {
  transform: rotate(180deg);
}

.arrow {
  position: absolute;
  z-index: 4;
  width: 6.5rem;
  height: 1.2rem;
  border: 4px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
}

.arrow::after {
  content: "";
  position: absolute;
  right: -1.2rem;
  top: 50%;
  width: 2.1rem;
  height: 2.1rem;
  border-top: 4px solid var(--line);
  border-right: 4px solid var(--line);
  background: #ffffff;
  transform: translateY(-50%) rotate(45deg);
}

.left-arrow {
  left: 16%;
  bottom: 43%;
  transform: rotate(180deg);
}

.right-arrow {
  right: 15%;
  bottom: 43%;
}

.shop-window {
  position: absolute;
  right: 7%;
  bottom: 24%;
  z-index: 2;
  width: 12rem;
  height: 9rem;
  border: 5px solid var(--line);
  border-radius: 8px;
  background:
    radial-gradient(ellipse at 35% 60%, #e4a84c 0 15%, transparent 16%),
    radial-gradient(ellipse at 65% 60%, #e4a84c 0 15%, transparent 16%),
    linear-gradient(to bottom, #ffffff 0 62%, #f5d096 63% 100%);
  box-shadow: 6px 6px 0 var(--line);
}

.restaurant-front {
  position: absolute;
  left: 8%;
  top: 10%;
  z-index: 1;
  width: 52%;
  min-height: 34%;
  padding: 0.7rem 0.9rem;
  border: 5px solid var(--line);
  border-radius: 14px 14px 4px 4px;
  background:
    linear-gradient(90deg, #111111 0 33%, #f24c3d 33% 66%, #ffd34f 66% 100%);
  box-shadow: 5px 5px 0 rgba(32, 32, 32, 0.2);
  color: #ffffff;
  font-weight: 900;
  text-align: center;
  text-shadow: 2px 2px 0 #111111;
}

.restaurant-front::after {
  content: "";
  position: absolute;
  left: 14%;
  right: 14%;
  bottom: -22%;
  height: 38%;
  border: 4px solid var(--line);
  border-bottom: 0;
  border-radius: 999px 999px 0 0;
  background: rgba(255, 255, 255, 0.82);
}

.table {
  position: absolute;
  left: 26%;
  bottom: 17%;
  z-index: 1;
  width: 48%;
  height: 14%;
  border: 4px solid var(--line);
  border-radius: 999px;
  background: #ffe6a6;
  box-shadow: 0 14px 0 rgba(112, 68, 28, 0.18);
}

.stall-sign {
  position: absolute;
  left: 17%;
  top: 10%;
  z-index: 1;
  padding: 0.4rem 0.65rem;
  border: 4px solid var(--line);
  border-radius: 8px;
  background: #fff7c8;
  box-shadow: 3px 3px 0 rgba(32, 32, 32, 0.2);
  font-weight: 900;
}

.waste-bottle {
  position: absolute;
  right: 16%;
  bottom: 10%;
  z-index: 3;
  width: min(23%, 122px);
  aspect-ratio: 0.55;
  border: 5px solid var(--line);
  border-radius: 18px 18px 14px 14px;
  background:
    radial-gradient(circle at 50% 54%, #1a1a1a 0 9%, transparent 10%),
    conic-gradient(from 0deg, #c8ff68 0 16%, transparent 16% 33%, #c8ff68 33% 49%, transparent 49% 66%, #c8ff68 66% 82%, transparent 82% 100%),
    linear-gradient(to bottom, #dffff0 0 24%, #9dff77 24% 100%);
  box-shadow: inset -8px -10px 0 rgba(0, 0, 0, 0.12), 6px 7px 0 rgba(32, 32, 32, 0.14);
}

.waste-bottle::before {
  content: "";
  position: absolute;
  left: 25%;
  right: 25%;
  top: -18%;
  height: 20%;
  border: 5px solid var(--line);
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
  background: #dffff0;
}

.waste-bottle.found {
  right: 20%;
  transform: rotate(8deg);
}

.empty-spot {
  position: absolute;
  right: 18%;
  bottom: 15%;
  z-index: 1;
  width: min(24%, 140px);
  aspect-ratio: 1.35;
  border: 4px dashed rgba(32, 32, 32, 0.5);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.4);
}

.green-cloud {
  position: absolute;
  inset: 12% 20% 12% 20%;
  z-index: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 40%, rgba(103, 255, 117, 0.42), transparent 34%),
    radial-gradient(circle at 65% 60%, rgba(103, 255, 117, 0.34), transparent 38%);
  filter: blur(4px);
}

.cold-sweat {
  position: absolute;
  left: 34%;
  top: 35%;
  z-index: 5;
  width: 1rem;
  aspect-ratio: 0.72;
  border-radius: 50% 50% 58% 58%;
  background: #74d8ff;
  box-shadow:
    1.2rem 1.4rem 0 #74d8ff,
    2rem -0.9rem 0 #74d8ff;
}

.big-word {
  position: absolute;
  top: 9%;
  z-index: 3;
  color: #ffffff;
  font-size: clamp(5rem, 22vw, 13rem);
  font-weight: 900;
  line-height: 1;
}

.smaller-word {
  top: 12%;
  font-size: clamp(4rem, 17vw, 10rem);
}

.closed-sign {
  position: absolute;
  left: 27%;
  top: 16%;
  z-index: 3;
  padding: 0.55rem 0.8rem;
  border: 4px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 4px 4px 0 rgba(32, 32, 32, 0.18);
  font-weight: 900;
  transform: rotate(-4deg);
}

.portal-ring {
  position: absolute;
  left: 50%;
  top: 48%;
  z-index: 1;
  width: min(58%, 320px);
  aspect-ratio: 1;
  border: 10px solid #5b7cff;
  border-radius: 50%;
  box-shadow:
    0 0 0 10px rgba(255, 255, 255, 0.85),
    0 0 28px rgba(43, 127, 255, 0.72);
  transform: translate(-50%, -50%);
}

.generated-cover-scene {
  display: grid;
  place-items: center;
  padding: 0;
  aspect-ratio: 1717 / 916;
  background: #fffaf0;
}

.generated-cover-scene::after {
  opacity: 0.08;
}

.generated-cover {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.cover-label {
  position: absolute;
  left: 50%;
  bottom: 7%;
  z-index: 4;
  padding: 0.55rem 1rem;
  border: 4px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 253, 244, 0.94);
  box-shadow: 5px 5px 0 rgba(32, 32, 32, 0.22);
  font-size: clamp(1.25rem, 2.6vw, 2rem);
  font-weight: 900;
  transform: translateX(-50%) rotate(-1deg);
}

.generated-panel-scene {
  aspect-ratio: auto;
  min-height: 0;
  background: #f7fbff;
}

.square-generated-scene {
  aspect-ratio: auto;
}

.wide-generated-scene {
  aspect-ratio: auto;
}

.ultra-wide-generated-scene {
  aspect-ratio: auto;
}

.generated-panel-scene::after {
  opacity: 0.08;
}

.panel-art {
  position: relative;
  display: block;
  z-index: 1;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.generated-panel-scene .comic-bubble,
.generated-cover-scene .comic-bubble {
  max-width: min(52%, 18rem);
  padding: 0.55rem 0.7rem;
  border-width: 3px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.96);
  font-size: clamp(0.95rem, 1.65vw, 1.25rem);
}

.generated-panel-scene .comic-bubble::after,
.generated-cover-scene .comic-bubble::after {
  bottom: -11px;
  width: 18px;
  height: 18px;
  border-right-width: 3px;
  border-bottom-width: 3px;
}

.generated-panel-scene .comic-bubble.top-right::after,
.generated-cover-scene .comic-bubble.top-right::after {
  right: 24px;
  left: auto;
}

.panel-scene.spaceship-room {
  background:
    radial-gradient(circle at 78% 18%, rgba(255, 255, 255, 0.95) 0 3px, transparent 4px),
    radial-gradient(circle at 68% 27%, rgba(255, 255, 255, 0.9) 0 2px, transparent 3px),
    linear-gradient(transparent 66%, rgba(60, 69, 92, 0.42) 67%),
    linear-gradient(145deg, #dfeaff, #edf2ff 46%, #dce6f6);
}

.panel-scene.spaceship-room::before,
.panel-scene.magic-classroom::before {
  content: "";
  position: absolute;
  left: 7%;
  right: 7%;
  bottom: 30%;
  z-index: 1;
  height: 5px;
  border-radius: 999px;
  background: rgba(25, 25, 25, 0.18);
}

.alien-xha {
  position: absolute;
  z-index: 4;
  width: min(23%, 132px);
  aspect-ratio: 1.05;
  border: 6px solid var(--line);
  border-radius: 18%;
  background:
    radial-gradient(circle at 35% 40%, #ffffff 0 8%, transparent 9%),
    radial-gradient(circle at 65% 40%, #ffffff 0 8%, transparent 9%),
    linear-gradient(145deg, #57df8b, #24a95a);
  box-shadow:
    inset -10px -12px 0 rgba(0, 0, 0, 0.12),
    0 10px 0 rgba(0, 0, 0, 0.14);
}

.alien-xha::before,
.alien-xha::after {
  content: "";
  position: absolute;
  top: -23%;
  width: 5px;
  height: 26%;
  border-radius: 999px;
  background: var(--line);
}

.alien-xha::before {
  left: 27%;
  transform: rotate(-19deg);
}

.alien-xha::after {
  right: 27%;
  transform: rotate(19deg);
}

.alien-xha.left {
  left: 14%;
  bottom: 18%;
}

.alien-xha.center {
  left: 50%;
  bottom: 19%;
  transform: translateX(-50%);
}

.alien-xha.right {
  right: 13%;
  bottom: 18%;
}

.alien-xha.small {
  width: min(17%, 94px);
}

.alien-xha.glow {
  box-shadow:
    0 0 0 10px rgba(122, 242, 170, 0.28),
    0 0 34px rgba(76, 220, 134, 0.75),
    inset -10px -12px 0 rgba(0, 0, 0, 0.12);
}

.xha-block {
  position: absolute;
  z-index: 5;
  width: min(24%, 140px);
  aspect-ratio: 1;
  border: 6px solid var(--line);
  border-radius: 10px;
  background:
    radial-gradient(circle at 34% 42%, #111111 0 5%, transparent 6%),
    radial-gradient(circle at 66% 42%, #111111 0 5%, transparent 6%),
    linear-gradient(145deg, #ffffff, #eef5ff);
  box-shadow:
    inset -10px -12px 0 rgba(0, 0, 0, 0.08),
    0 12px 0 rgba(0, 0, 0, 0.14);
}

.xha-block.left {
  left: 14%;
  bottom: 18%;
}

.xha-block.center {
  left: 50%;
  bottom: 18%;
  transform: translateX(-50%);
}

.xha-block.right {
  right: 13%;
  bottom: 18%;
}

.xha-block.small {
  width: min(17%, 96px);
}

.xha-block.glow {
  box-shadow:
    0 0 0 10px rgba(227, 244, 255, 0.42),
    0 0 34px rgba(122, 207, 255, 0.8),
    inset -10px -12px 0 rgba(0, 0, 0, 0.08);
}

.xha-block.crack::after {
  content: "";
  position: absolute;
  left: 46%;
  top: 8%;
  width: 8%;
  height: 78%;
  background: #111111;
  clip-path: polygon(40% 0, 100% 22%, 48% 38%, 90% 58%, 32% 75%, 70% 100%, 0 100%, 34% 72%, 0 55%, 42% 37%, 6% 15%);
  opacity: 0.85;
}

.battle-room {
  background:
    radial-gradient(circle at 82% 18%, rgba(255, 255, 255, 0.95) 0 3px, transparent 4px),
    radial-gradient(circle at 68% 27%, rgba(255, 255, 255, 0.9) 0 2px, transparent 3px),
    linear-gradient(transparent 66%, rgba(42, 57, 80, 0.44) 67%),
    linear-gradient(145deg, #d5ecff, #eaf2ff 46%, #c8d8f4);
}

.dark-battle {
  background:
    radial-gradient(circle at 16% 20%, rgba(255, 60, 60, 0.28), transparent 18%),
    linear-gradient(transparent 66%, rgba(25, 30, 44, 0.5) 67%),
    linear-gradient(145deg, #1b2a46, #405b8d);
}

.xha-cover-scene {
  color: #ffffff;
}

.impact-burst {
  position: absolute;
  left: 47%;
  bottom: 36%;
  z-index: 4;
  width: min(25%, 150px);
  aspect-ratio: 1;
  background: #ffd86a;
  clip-path: polygon(50% 0, 61% 33%, 98% 18%, 72% 49%, 100% 66%, 64% 66%, 68% 100%, 48% 72%, 22% 100%, 31% 63%, 0 58%, 31% 43%, 14% 11%, 43% 31%);
  filter: drop-shadow(0 0 12px rgba(255, 94, 75, 0.65));
}

.energy-slash {
  position: absolute;
  left: 38%;
  bottom: 36%;
  z-index: 6;
  width: min(42%, 240px);
  height: 1.1rem;
  border: 4px solid var(--line);
  border-radius: 999px;
  background: linear-gradient(90deg, #ffffff, #75d8ff, #ffffff);
  box-shadow: 0 0 18px rgba(117, 216, 255, 0.8);
  transform: rotate(-18deg);
}

.double-slash {
  box-shadow:
    0 0 18px rgba(117, 216, 255, 0.8),
    0 2.2rem 0 rgba(255, 255, 255, 0.78);
}

.red-splatter {
  position: absolute;
  z-index: 7;
  width: min(18%, 110px);
  aspect-ratio: 1;
  background:
    radial-gradient(circle at 32% 42%, #b30020 0 18%, transparent 19%),
    radial-gradient(circle at 58% 52%, #e21d2f 0 14%, transparent 15%),
    radial-gradient(circle at 72% 28%, #b30020 0 8%, transparent 9%),
    radial-gradient(circle at 20% 70%, #e21d2f 0 7%, transparent 8%);
  opacity: 0.9;
  transform: rotate(-12deg);
}

.splatter-one {
  left: 45%;
  bottom: 28%;
}

.splatter-two {
  left: 25%;
  bottom: 24%;
}

.splatter-three {
  right: 35%;
  bottom: 25%;
}

.splatter-four {
  left: 52%;
  bottom: 30%;
}

.danger-screen {
  background:
    linear-gradient(120deg, transparent 0 46%, #ff4f5f 47% 54%, transparent 55%),
    radial-gradient(circle at 66% 48%, #ffdf6a 0 8%, transparent 9%),
    #271a2f;
}

.red-rocket::before {
  background: linear-gradient(90deg, #ffef7b, #d9002b);
}

.laser-gun {
  position: absolute;
  z-index: 8;
  width: min(30%, 175px);
  height: 1.1rem;
  border: 4px solid var(--line);
  border-radius: 999px;
  background:
    linear-gradient(90deg, #1d2438 0 58%, #62d8ff 59% 74%, #f2f7ff 75% 100%);
  box-shadow: 4px 5px 0 rgba(32, 32, 32, 0.22);
}

.laser-gun::before {
  content: "";
  position: absolute;
  left: 32%;
  top: 80%;
  width: 1.1rem;
  height: 1.8rem;
  border: 4px solid var(--line);
  border-top: 0;
  border-radius: 0 0 8px 8px;
  background: #29314b;
}

.poland-gun {
  left: 25%;
  bottom: 26%;
  transform: rotate(-8deg);
}

.xha-laser {
  position: absolute;
  left: 24%;
  bottom: 36%;
  z-index: 7;
  width: min(18%, 105px);
  aspect-ratio: 1;
  border: 5px solid var(--line);
  border-radius: 12px;
  background:
    radial-gradient(circle at 50% 50%, #ffffff 0 18%, #97dfff 19% 42%, #1c3d66 43% 100%);
  box-shadow: 0 0 24px rgba(135, 222, 255, 0.78);
}

.laser-beam {
  position: absolute;
  z-index: 7;
  height: 0.85rem;
  border: 3px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 0 20px currentColor;
}

.blue-beam {
  left: 38%;
  bottom: 35%;
  width: min(38%, 230px);
  color: #50d8ff;
  background: linear-gradient(90deg, #ffffff, #50d8ff, #ffffff);
  transform: rotate(-5deg);
}

.white-beam {
  left: 30%;
  bottom: 40%;
  width: min(44%, 260px);
  color: #e9f7ff;
  background: linear-gradient(90deg, #ffffff, #dff7ff, #ffffff);
  transform: rotate(8deg);
}

.split-beam {
  left: 34%;
  bottom: 36%;
  width: min(44%, 260px);
  color: #65e1ff;
  background: linear-gradient(90deg, #ffffff, #65e1ff, #ffffff);
  transform: rotate(-15deg);
  box-shadow:
    0 0 20px rgba(101, 225, 255, 0.9),
    0 2rem 0 rgba(255, 255, 255, 0.86);
}

.scifi-ship {
  position: absolute;
  z-index: 3;
  width: min(30%, 180px);
  aspect-ratio: 2.2;
  border: 5px solid var(--line);
  border-radius: 60% 60% 28% 28%;
  background:
    radial-gradient(circle at 74% 52%, #8adfff 0 8%, transparent 9%),
    linear-gradient(145deg, #eaf7ff, #7fa7c8);
  box-shadow: 5px 7px 0 rgba(32, 32, 32, 0.22);
}

.small-ship {
  right: 9%;
  top: 16%;
  transform: rotate(-8deg);
}

.crashed-ship {
  left: 42%;
  bottom: 18%;
  transform: rotate(18deg);
}

.earth-view,
.earth-planet {
  position: absolute;
  z-index: 2;
  border: 5px solid var(--line);
  border-radius: 50%;
  background:
    radial-gradient(circle at 60% 40%, #48b86f 0 10%, transparent 11%),
    radial-gradient(circle at 38% 58%, #48b86f 0 14%, transparent 15%),
    radial-gradient(circle at 28% 34%, #ffffff 0 9%, transparent 10%),
    #2b7fff;
  box-shadow: inset -13px -16px 0 rgba(0, 0, 0, 0.16), 5px 6px 0 rgba(32, 32, 32, 0.2);
}

.earth-view {
  right: 10%;
  bottom: 12%;
  width: min(21%, 120px);
  aspect-ratio: 1;
}

.earth-orbit {
  background:
    radial-gradient(circle at 25% 22%, #ffffff 0 2px, transparent 3px),
    radial-gradient(circle at 80% 30%, #ffffff 0 3px, transparent 4px),
    linear-gradient(145deg, #102040, #244f86);
}

.earth-planet {
  left: 50%;
  bottom: -24%;
  width: min(48%, 280px);
  aspect-ratio: 1;
  transform: translateX(-50%);
}

.earth-cross-section,
.earth-core-battle {
  background:
    radial-gradient(circle at 50% 92%, rgba(255, 104, 69, 0.72), transparent 22%),
    linear-gradient(transparent 42%, rgba(120, 83, 52, 0.36) 43% 67%, rgba(64, 54, 72, 0.45) 68%),
    linear-gradient(145deg, #cfeaff, #80664e);
}

.earth-core-battle {
  background:
    radial-gradient(circle at 52% 76%, rgba(255, 91, 62, 0.72), transparent 24%),
    radial-gradient(circle at 72% 18%, rgba(255, 255, 255, 0.95) 0 3px, transparent 4px),
    linear-gradient(transparent 42%, rgba(52, 46, 67, 0.62) 43%),
    linear-gradient(145deg, #273a68, #6e4a3b);
}

.underground-base {
  position: absolute;
  left: 18%;
  bottom: 16%;
  z-index: 3;
  width: min(42%, 245px);
  height: 6rem;
  border: 5px solid var(--line);
  border-radius: 18px 18px 6px 6px;
  background:
    linear-gradient(90deg, transparent 0 14%, #73d8ff 15% 24%, transparent 25% 39%, #73d8ff 40% 49%, transparent 50%),
    linear-gradient(#eaf7ff, #8da5b8);
  box-shadow: 6px 6px 0 rgba(32, 32, 32, 0.25);
}

.underground-base::before {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  top: -1.6rem;
  height: 1.6rem;
  border: 5px solid var(--line);
  border-bottom: 0;
  border-radius: 999px 999px 0 0;
  background: #c8d8e8;
}

.far-base {
  left: 42%;
  bottom: 14%;
  transform: scale(0.78);
  opacity: 0.88;
}

.sci-rack {
  right: 7%;
  top: 16%;
  width: min(36%, 210px);
}

.sci-rack span {
  min-height: 2.7rem;
  background:
    linear-gradient(90deg, #1d2438 0 62%, #62d8ff 63% 76%, #f2f7ff 77% 100%);
}

.casino-number {
  background: linear-gradient(145deg, #ffe070, #ff8a45);
}

.casino-room {
  background:
    radial-gradient(circle at 48% 18%, rgba(255, 232, 135, 0.9), transparent 16%),
    linear-gradient(90deg, rgba(116, 43, 33, 0.32) 0 8%, transparent 8% 92%, rgba(116, 43, 33, 0.32) 92%),
    linear-gradient(transparent 64%, rgba(72, 38, 27, 0.36) 65%),
    linear-gradient(145deg, #ffdca3, #ffb37c 48%, #ffe6bc);
}

.casino-page .comic-bubble {
  max-width: min(42%, 13.5rem);
}

.casino-page .small-bubble {
  max-width: min(34%, 11rem);
}

.casino-page .comic-bubble.top-right {
  top: 27%;
}

.casino-generated-scene {
  aspect-ratio: 512 / 341;
  min-height: 0;
}

.casino-generated-scene .panel-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.casino-opening {
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 239, 158, 0.95), transparent 18%),
    linear-gradient(transparent 64%, rgba(64, 91, 67, 0.36) 65%),
    linear-gradient(145deg, #ffcf8a, #ffd9b1);
}

.card-table {
  position: absolute;
  left: 50%;
  bottom: 14%;
  z-index: 3;
  width: min(44%, 250px);
  height: 6.2rem;
  border: 5px solid var(--line);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 44%, #268b58 0 46%, #176940 47% 100%);
  box-shadow: 0 1.1rem 0 #6b3526, 7px 9px 0 rgba(32, 32, 32, 0.24);
  transform: translateX(-50%);
}

.small-table {
  width: min(36%, 210px);
  bottom: 17%;
}

.movie-board,
.rule-sign {
  position: absolute;
  z-index: 5;
  display: grid;
  place-items: center;
  min-width: 7.5rem;
  min-height: 3.2rem;
  padding: 0.45rem 0.75rem;
  border: 4px solid var(--line);
  border-radius: 8px;
  background: #fffdf4;
  box-shadow: 5px 5px 0 rgba(32, 32, 32, 0.24);
  font-weight: 900;
}

.movie-board {
  left: 50%;
  top: 40%;
  transform: translateX(-50%) rotate(-2deg);
}

.finale-board {
  top: 22%;
  font-size: clamp(1.35rem, 3vw, 2.2rem);
  background: #ffe070;
}

.shoe-prop {
  position: absolute;
  z-index: 5;
  width: min(30%, 170px);
  aspect-ratio: 2.35;
  border: 5px solid var(--line);
  border-radius: 72% 28% 28% 20% / 60% 42% 36% 34%;
  background:
    radial-gradient(ellipse at 74% 32%, rgba(255, 255, 255, 0.62) 0 12%, transparent 13%),
    linear-gradient(145deg, #1d1d1f, #4b2b1d 64%, #111111);
  box-shadow: 5px 7px 0 rgba(32, 32, 32, 0.25);
}

.big-shoe {
  left: 41%;
  bottom: 16%;
}

.mirror-shoe {
  left: 42%;
  bottom: 18%;
  background:
    radial-gradient(ellipse at 64% 30%, rgba(255, 255, 255, 0.95) 0 18%, transparent 19%),
    linear-gradient(145deg, #101114, #5b3727 64%, #0a0a0a);
}

.tiny-shoe {
  right: 24%;
  bottom: 18%;
  width: min(22%, 120px);
}

.shoe-brush {
  position: absolute;
  left: 35%;
  bottom: 31%;
  z-index: 6;
  width: min(20%, 112px);
  height: 1.5rem;
  border: 4px solid var(--line);
  border-radius: 999px;
  background: #8b4c2b;
  transform: rotate(-16deg);
  box-shadow: 4px 4px 0 rgba(32, 32, 32, 0.22);
}

.shoe-brush::after {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  top: 100%;
  height: 0.85rem;
  background: repeating-linear-gradient(90deg, #111111 0 4px, #4b2b1d 4px 8px);
}

.smoke-card {
  position: absolute;
  left: 42%;
  bottom: 22%;
  z-index: 5;
  display: grid;
  place-items: center;
  width: min(24%, 136px);
  aspect-ratio: 0.72;
  border: 5px solid var(--line);
  border-radius: 10px;
  background: #fffdf4;
  box-shadow: 5px 5px 0 rgba(32, 32, 32, 0.22);
  color: #c93329;
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 900;
  transform: rotate(-8deg);
}

.finale-card {
  left: 18%;
  bottom: 17%;
  width: min(20%, 120px);
  font-size: clamp(1rem, 2.6vw, 1.55rem);
}

.smoke-puff {
  position: absolute;
  z-index: 4;
  width: 7rem;
  aspect-ratio: 1.5;
  border: 4px solid rgba(17, 17, 17, 0.65);
  border-radius: 999px;
  background:
    radial-gradient(circle at 28% 50%, rgba(255, 255, 255, 0.86) 0 30%, transparent 31%),
    radial-gradient(circle at 55% 36%, rgba(255, 255, 255, 0.86) 0 28%, transparent 29%),
    radial-gradient(circle at 74% 56%, rgba(255, 255, 255, 0.86) 0 25%, transparent 26%),
    rgba(195, 195, 184, 0.72);
}

.puff-one {
  left: 30%;
  top: 28%;
}

.puff-two {
  left: 48%;
  top: 18%;
  transform: scale(0.75);
}

.puff-three {
  left: 52%;
  top: 22%;
  transform: rotate(8deg);
}

.card-burst {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.card-burst span,
.coupon-rain span {
  position: absolute;
  display: grid;
  place-items: center;
  border: 4px solid var(--line);
  border-radius: 8px;
  background: #fffdf4;
  box-shadow: 4px 4px 0 rgba(32, 32, 32, 0.22);
  font-weight: 900;
}

.card-burst span {
  width: 3.6rem;
  height: 5rem;
  color: #c93329;
  font-size: 1.6rem;
}

.card-burst span:nth-child(1) {
  left: 25%;
  bottom: 32%;
  transform: rotate(-21deg);
}

.card-burst span:nth-child(2) {
  left: 39%;
  bottom: 45%;
  transform: rotate(13deg);
}

.card-burst span:nth-child(3) {
  right: 28%;
  bottom: 34%;
  transform: rotate(25deg);
}

.card-burst span:nth-child(4) {
  right: 40%;
  top: 30%;
  color: #111111;
  transform: rotate(-10deg);
}

.rule-sign {
  left: 50%;
  bottom: 24%;
  background: #fff0c9;
  transform: translateX(-50%);
}

.shine-lines {
  position: absolute;
  left: 48%;
  bottom: 32%;
  z-index: 6;
  width: min(18%, 108px);
  aspect-ratio: 1;
  background:
    linear-gradient(90deg, transparent 45%, #ffffff 46% 54%, transparent 55%),
    linear-gradient(0deg, transparent 45%, #ffffff 46% 54%, transparent 55%),
    linear-gradient(45deg, transparent 46%, #ffe070 47% 53%, transparent 54%);
  filter: drop-shadow(0 0 8px rgba(255, 224, 112, 0.9));
  transform: rotate(18deg);
}

.coupon-rain {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.coupon-rain span {
  width: 5.3rem;
  height: 2.8rem;
  background: #ffe070;
  font-size: 0.9rem;
}

.coupon-rain span:nth-child(1) {
  left: 35%;
  top: 32%;
  transform: rotate(-14deg);
}

.coupon-rain span:nth-child(2) {
  left: 47%;
  top: 48%;
  transform: rotate(8deg);
}

.coupon-rain span:nth-child(3) {
  right: 19%;
  top: 29%;
  transform: rotate(18deg);
}

.history-number {
  background: linear-gradient(145deg, #d8c7a4, #f06b4f);
}

.history-room {
  background:
    radial-gradient(circle at 18% 15%, rgba(255, 255, 255, 0.72), transparent 15%),
    linear-gradient(transparent 65%, rgba(89, 77, 58, 0.26) 66%),
    linear-gradient(145deg, #e9dfc9, #d7ebf5 56%, #fff0c7);
}

.history-page .comic-bubble {
  max-width: min(45%, 14rem);
}

.history-page .small-bubble {
  max-width: min(35%, 11rem);
}

.history-fact {
  position: absolute;
  z-index: 6;
  max-width: min(46%, 18rem);
  padding: 0.42rem 0.58rem;
  border: 3px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 253, 244, 0.94);
  box-shadow: 3px 3px 0 rgba(32, 32, 32, 0.2);
  color: #2f2a25;
  font-size: clamp(0.68rem, 0.74vw, 0.86rem);
  font-weight: 900;
  line-height: 1.22;
}

.history-fact.top-board {
  right: 4%;
  bottom: 6%;
  transform: rotate(1.5deg);
}

.history-fact.map-label {
  left: 4%;
  bottom: 6%;
  transform: rotate(-1.5deg);
}

.history-map,
.history-year,
.history-sign,
.sandbag-wall,
.cloud-row,
.paper-plane,
.ocean-wave,
.snow-cloud,
.frozen-tank,
.beach-boat,
.red-splash,
.white-flag,
.peace-bell {
  position: absolute;
  z-index: 4;
}

.history-map {
  left: 50%;
  bottom: 20%;
  width: min(40%, 235px);
  aspect-ratio: 1.35;
  border: 5px solid var(--line);
  border-radius: 10px;
  background:
    linear-gradient(115deg, transparent 0 38%, rgba(32, 32, 32, 0.75) 39% 42%, transparent 43%),
    radial-gradient(circle at 32% 42%, #7fcf75 0 18%, transparent 19%),
    radial-gradient(circle at 62% 46%, #ffd36b 0 22%, transparent 23%),
    #fffdf4;
  box-shadow: 5px 5px 0 rgba(32, 32, 32, 0.23);
  transform: translateX(-50%) rotate(-3deg);
}

.torn-map {
  bottom: 18%;
  background:
    linear-gradient(90deg, transparent 0 46%, #e34f43 47% 53%, transparent 54%),
    radial-gradient(circle at 35% 42%, #7fcf75 0 18%, transparent 19%),
    radial-gradient(circle at 66% 46%, #ffd36b 0 20%, transparent 21%),
    #fffdf4;
}

.history-year,
.history-sign {
  display: grid;
  place-items: center;
  min-width: 5.4rem;
  min-height: 2.8rem;
  padding: 0.35rem 0.6rem;
  border: 4px solid var(--line);
  border-radius: 8px;
  background: #fffdf4;
  box-shadow: 4px 4px 0 rgba(32, 32, 32, 0.24);
  font-weight: 900;
}

.history-year {
  left: 45%;
  top: 20%;
  transform: rotate(-4deg);
}

.small-year {
  left: 50%;
  top: 16%;
}

.final-year {
  left: 50%;
  top: 13%;
  background: #ffe070;
  transform: translateX(-50%) rotate(2deg);
}

.history-sign {
  left: 50%;
  bottom: 31%;
  transform: translateX(-50%) rotate(3deg);
}

.sandbag-wall {
  left: 34%;
  bottom: 18%;
  width: min(38%, 220px);
  height: 4.8rem;
  background:
    radial-gradient(ellipse at 18% 65%, #b7996b 0 15%, transparent 16%),
    radial-gradient(ellipse at 38% 42%, #c2a375 0 15%, transparent 16%),
    radial-gradient(ellipse at 58% 68%, #ad8e62 0 15%, transparent 16%),
    radial-gradient(ellipse at 80% 45%, #c8ac7e 0 15%, transparent 16%);
  filter: drop-shadow(5px 5px 0 rgba(32, 32, 32, 0.24));
}

.cloud-row {
  left: 23%;
  right: 20%;
  top: 32%;
  height: 4.4rem;
  background:
    radial-gradient(circle at 20% 62%, #ffffff 0 22%, transparent 23%),
    radial-gradient(circle at 39% 42%, #ffffff 0 28%, transparent 29%),
    radial-gradient(circle at 62% 58%, #ffffff 0 24%, transparent 25%),
    radial-gradient(circle at 79% 42%, #ffffff 0 19%, transparent 20%);
}

.paper-plane {
  width: 4.2rem;
  height: 2.4rem;
  clip-path: polygon(0 50%, 100% 0, 72% 50%, 100% 100%);
  border: 4px solid var(--line);
  background: #fffdf4;
  filter: drop-shadow(3px 4px 0 rgba(32, 32, 32, 0.2));
}

.plane-one {
  left: 39%;
  top: 42%;
  transform: rotate(11deg);
}

.plane-two {
  right: 29%;
  top: 30%;
  transform: rotate(-9deg) scale(0.8);
}

.ocean-room {
  background:
    linear-gradient(transparent 62%, rgba(32, 128, 191, 0.55) 63%),
    linear-gradient(145deg, #dff4ff, #e9fbff);
}

.ocean-wave {
  left: 24%;
  right: 22%;
  bottom: 18%;
  height: 4.6rem;
  background:
    radial-gradient(circle at 14% 45%, #ffffff 0 10%, transparent 11%),
    radial-gradient(circle at 34% 48%, #ffffff 0 10%, transparent 11%),
    radial-gradient(circle at 54% 46%, #ffffff 0 10%, transparent 11%),
    radial-gradient(circle at 74% 48%, #ffffff 0 10%, transparent 11%),
    #3aa6d8;
  border: 4px solid rgba(32, 32, 32, 0.7);
  border-radius: 999px;
}

.winter-room {
  background:
    radial-gradient(circle at 25% 25%, rgba(255, 255, 255, 0.88), transparent 18%),
    linear-gradient(transparent 64%, rgba(176, 214, 230, 0.58) 65%),
    linear-gradient(145deg, #eefbff, #d8edf7);
}

.snow-cloud {
  left: 30%;
  top: 17%;
  width: min(38%, 220px);
  height: 5.2rem;
  background:
    radial-gradient(circle at 20% 55%, #ffffff 0 22%, transparent 23%),
    radial-gradient(circle at 42% 36%, #ffffff 0 25%, transparent 26%),
    radial-gradient(circle at 66% 55%, #ffffff 0 24%, transparent 25%);
  filter: drop-shadow(0 10px 0 rgba(93, 139, 169, 0.18));
}

.frozen-tank {
  left: 42%;
  bottom: 17%;
  width: min(32%, 180px);
  height: 4.2rem;
  border: 5px solid var(--line);
  border-radius: 12px;
  background:
    linear-gradient(90deg, #8092a0 0 62%, #4f5f68 63% 100%);
  box-shadow: 5px 5px 0 rgba(32, 32, 32, 0.22);
}

.frozen-tank::after {
  content: "";
  position: absolute;
  right: -2.8rem;
  top: 0.9rem;
  width: 3.4rem;
  height: 0.7rem;
  border: 4px solid var(--line);
  border-left: 0;
  background: #6f818d;
}

.beach-room {
  background:
    linear-gradient(transparent 60%, rgba(239, 200, 128, 0.74) 61%),
    linear-gradient(145deg, #dff6ff, #fff0bd);
}

.beach-boat {
  left: 40%;
  bottom: 18%;
  width: min(34%, 200px);
  height: 4.5rem;
  border: 5px solid var(--line);
  border-radius: 0 0 26px 26px;
  background: #697985;
  box-shadow: 5px 5px 0 rgba(32, 32, 32, 0.24);
}

.paint-room {
  background:
    linear-gradient(transparent 65%, rgba(83, 93, 72, 0.22) 66%),
    linear-gradient(145deg, #efe8d4, #e7f3ff);
}

.red-splash {
  width: min(20%, 118px);
  aspect-ratio: 1.2;
  border-radius: 57% 43% 62% 38%;
  background:
    radial-gradient(circle at 22% 30%, #ff9f8c 0 8%, transparent 9%),
    #e24a3b;
  filter: drop-shadow(3px 4px 0 rgba(32, 32, 32, 0.18));
}

.paint-one {
  left: 48%;
  bottom: 26%;
  transform: rotate(-14deg);
}

.paint-two {
  left: 38%;
  bottom: 28%;
  transform: rotate(9deg) scale(1.15);
}

.white-flag {
  right: 23%;
  bottom: 27%;
  width: 4.7rem;
  height: 3rem;
  border: 4px solid var(--line);
  border-left-width: 7px;
  background: #ffffff;
  transform: rotate(5deg);
}

.peace-bell {
  left: 50%;
  bottom: 24%;
  width: min(19%, 112px);
  aspect-ratio: 0.9;
  border: 5px solid var(--line);
  border-radius: 50% 50% 18% 18%;
  background: #ffe070;
  box-shadow: 5px 5px 0 rgba(32, 32, 32, 0.23);
  transform: translateX(-50%);
}

.peace-bell::after {
  content: "";
  position: absolute;
  left: 34%;
  bottom: -0.7rem;
  width: 32%;
  height: 1rem;
  border: 4px solid var(--line);
  border-radius: 999px;
  background: #fffdf4;
}

.star-window {
  position: absolute;
  right: 8%;
  top: 14%;
  z-index: 1;
  width: min(30%, 150px);
  aspect-ratio: 1.35;
  border: 5px solid var(--line);
  border-radius: 24px;
  background:
    radial-gradient(circle at 30% 34%, #ffffff 0 3px, transparent 4px),
    radial-gradient(circle at 70% 58%, #ffffff 0 2px, transparent 3px),
    linear-gradient(145deg, #182647, #314a83);
}

.moon-cookie,
.giant-cookie {
  position: absolute;
  z-index: 5;
  width: min(20%, 112px);
  aspect-ratio: 1;
  border: 5px solid #7b4d21;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 38%, #8d5c2a 0 7%, transparent 8%),
    radial-gradient(circle at 62% 60%, #8d5c2a 0 6%, transparent 7%),
    #dba24f;
  box-shadow: 5px 6px 0 rgba(32, 32, 32, 0.2);
}

.moon-cookie {
  left: 50%;
  bottom: 27%;
  transform: translateX(-50%) rotate(12deg);
}

.warning-light {
  position: absolute;
  left: 9%;
  top: 13%;
  z-index: 4;
  width: 4.2rem;
  aspect-ratio: 1;
  border: 5px solid var(--line);
  border-radius: 50%;
  background: #ff4d43;
  box-shadow:
    0 0 0 8px rgba(255, 255, 255, 0.55),
    0 0 22px rgba(255, 62, 49, 0.68);
}

.tiny-rocket {
  position: absolute;
  left: 47%;
  bottom: 35%;
  z-index: 5;
  width: min(30%, 180px);
  height: 2.6rem;
  border: 5px solid var(--line);
  border-radius: 999px 36px 36px 999px;
  background:
    radial-gradient(circle at 78% 50%, #8fd4ff 0 13%, transparent 14%),
    linear-gradient(90deg, #ffffff 0 67%, #ff5a55 68% 100%);
  box-shadow: 5px 7px 0 rgba(32, 32, 32, 0.18);
  transform: translateX(-50%) rotate(-13deg);
}

.tiny-rocket::before {
  content: "";
  position: absolute;
  left: -22%;
  top: 28%;
  width: 25%;
  height: 42%;
  border-radius: 999px;
  background: linear-gradient(90deg, #ffd35c, #ff7c42);
}

.panel-scene.magic-classroom {
  background:
    linear-gradient(90deg, transparent 0 9%, rgba(108, 74, 45, 0.2) 9% 10%, transparent 10% 100%),
    linear-gradient(transparent 66%, rgba(127, 87, 55, 0.28) 67%),
    linear-gradient(145deg, #fff3cf, #e9f7ff);
}

.magic-wand {
  position: absolute;
  z-index: 5;
  width: min(30%, 170px);
  height: 0.75rem;
  border: 4px solid var(--line);
  border-radius: 999px;
  background: linear-gradient(90deg, #5a351f, #d4a55f);
  box-shadow: 4px 4px 0 rgba(32, 32, 32, 0.18);
  transform: rotate(-24deg);
}

.magic-wand::after {
  content: "";
  position: absolute;
  right: -1rem;
  top: 50%;
  width: 1.1rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #ffe66d;
  box-shadow: 0 0 18px rgba(255, 218, 73, 0.85);
  transform: translateY(-50%);
}

.wizard-hat {
  position: absolute;
  z-index: 6;
  width: min(23%, 132px);
  height: min(28%, 150px);
  border: 5px solid var(--line);
  border-radius: 50% 50% 12% 12%;
  background: linear-gradient(145deg, #4353b8, #232a77);
  clip-path: polygon(50% 0, 88% 79%, 100% 100%, 0 100%, 12% 79%);
}

.wizard-hat::after {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: 21%;
  height: 0.7rem;
  border-radius: 999px;
  background: #ffd84a;
}

.spell-circle {
  position: absolute;
  left: 54%;
  bottom: 24%;
  z-index: 3;
  width: min(31%, 180px);
  aspect-ratio: 1;
  border: 6px solid #7d64ff;
  border-radius: 50%;
  box-shadow:
    0 0 0 10px rgba(255, 255, 255, 0.5),
    0 0 24px rgba(125, 100, 255, 0.65);
  transform: translateX(-50%);
}

.spell-circle::before,
.spell-circle::after {
  content: "";
  position: absolute;
  inset: 22%;
  border: 4px solid #ffd84a;
  border-radius: 50%;
}

.spell-circle::after {
  inset: 42%;
  background: #ffd84a;
}

.giant-cookie {
  left: 49%;
  bottom: 16%;
  width: min(39%, 230px);
  transform: translateX(-50%) rotate(9deg);
}

.flying-books {
  position: absolute;
  left: 18%;
  right: 12%;
  top: 18%;
  z-index: 4;
  height: 6rem;
}

.flying-books span,
.book-pile span {
  position: absolute;
  width: 5.2rem;
  height: 3.2rem;
  border: 4px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(90deg, #ff6868 0 48%, #fffdf4 49% 54%, #4d86ff 55% 100%);
  box-shadow: 4px 4px 0 rgba(32, 32, 32, 0.16);
}

.flying-books span:nth-child(1) {
  left: 3%;
  top: 20%;
  transform: rotate(-18deg);
}

.flying-books span:nth-child(2) {
  left: 42%;
  top: 0;
  transform: rotate(9deg);
}

.flying-books span:nth-child(3) {
  right: 0;
  top: 28%;
  transform: rotate(21deg);
}

.book-pile {
  position: absolute;
  left: 49%;
  bottom: 19%;
  z-index: 5;
  width: min(38%, 220px);
  height: 7.5rem;
  transform: translateX(-50%);
}

.book-pile span:nth-child(1) {
  left: 3%;
  bottom: 0;
  transform: rotate(-3deg);
}

.book-pile span:nth-child(2) {
  left: 30%;
  bottom: 1.5rem;
  transform: rotate(8deg);
}

.book-pile span:nth-child(3) {
  right: 5%;
  bottom: 0.5rem;
  transform: rotate(-10deg);
}

.tiny-cookie-rain {
  position: absolute;
  inset: 9% 8% 36%;
  z-index: 4;
  pointer-events: none;
}

.tiny-cookie-rain span {
  position: absolute;
  width: 1.65rem;
  aspect-ratio: 1;
  border: 3px solid #7b4d21;
  border-radius: 50%;
  background: #dba24f;
}

.tiny-cookie-rain span:nth-child(1) {
  left: 14%;
  top: 20%;
}

.tiny-cookie-rain span:nth-child(2) {
  left: 43%;
  top: 4%;
}

.tiny-cookie-rain span:nth-child(3) {
  right: 16%;
  top: 30%;
}

.space-bridge {
  background:
    radial-gradient(circle at 82% 16%, rgba(255, 255, 255, 0.95) 0 3px, transparent 4px),
    radial-gradient(circle at 28% 24%, rgba(255, 255, 255, 0.9) 0 2px, transparent 3px),
    linear-gradient(transparent 66%, rgba(45, 82, 130, 0.34) 67%),
    linear-gradient(145deg, #cfeaff, #eaf7ff);
}

.space-bakery {
  background:
    radial-gradient(circle at 77% 19%, rgba(95, 196, 255, 0.46), transparent 18%),
    linear-gradient(transparent 64%, rgba(65, 85, 120, 0.24) 65%),
    linear-gradient(145deg, #e7f5ff, #fff0c9);
}

.deep-space {
  background:
    radial-gradient(circle at 15% 22%, #ffffff 0 2px, transparent 3px),
    radial-gradient(circle at 82% 24%, #ffffff 0 3px, transparent 4px),
    radial-gradient(circle at 58% 12%, rgba(114, 204, 255, 0.45), transparent 20%),
    linear-gradient(145deg, #17294a, #315c96);
}

.finale-space {
  color: #ffffff;
}

.signal-screen {
  position: absolute;
  left: 42%;
  bottom: 26%;
  z-index: 3;
  width: min(34%, 190px);
  aspect-ratio: 1.35;
  border: 5px solid var(--line);
  border-radius: 14px;
  background:
    linear-gradient(120deg, transparent 0 46%, #56d8ff 47% 54%, transparent 55%),
    radial-gradient(circle at 66% 48%, #ffdf6a 0 8%, transparent 9%),
    #15315c;
  box-shadow: 5px 6px 0 rgba(32, 32, 32, 0.2);
}

.small-portal {
  left: 52%;
  top: 55%;
  width: min(30%, 170px);
  border-color: #3aa7ff;
  transform: translate(-50%, -50%);
}

.trail {
  left: 42%;
  box-shadow:
    -2.6rem 0.25rem 0 rgba(255, 210, 82, 0.75),
    -4.6rem 0.25rem 0 rgba(255, 117, 76, 0.45),
    5px 7px 0 rgba(32, 32, 32, 0.18);
}

.orbit-cookie {
  left: 52%;
  bottom: 43%;
  animation: orbit-cookie 2.4s linear infinite;
}

.magic-library {
  background:
    linear-gradient(90deg, rgba(92, 54, 116, 0.18) 0 8%, transparent 8% 100%),
    linear-gradient(transparent 66%, rgba(98, 68, 118, 0.22) 67%),
    linear-gradient(145deg, #f4e6ff, #fff3d7);
}

.magic-tower {
  background:
    radial-gradient(circle at 72% 18%, rgba(255, 235, 141, 0.48), transparent 18%),
    linear-gradient(transparent 66%, rgba(112, 76, 135, 0.25) 67%),
    linear-gradient(145deg, #eadcff, #fff0fb);
}

.spell-book {
  position: absolute;
  right: 15%;
  bottom: 22%;
  z-index: 4;
  width: min(34%, 190px);
  aspect-ratio: 1.4;
  border: 5px solid var(--line);
  border-radius: 14px;
  background:
    radial-gradient(circle at 50% 50%, #ffd84a 0 9%, transparent 10%),
    linear-gradient(90deg, #7346b5 0 48%, #fffdf4 49% 54%, #9d5be8 55% 100%);
  box-shadow: 6px 6px 0 rgba(32, 32, 32, 0.2);
  transform: rotate(-7deg);
}

.magic-stack {
  left: 44%;
  bottom: 24%;
}

.tower-circle {
  left: 58%;
  bottom: 24%;
}

.purple-portal {
  left: 54%;
  top: 52%;
  width: min(35%, 210px);
  border-color: #9b64ff;
  box-shadow:
    0 0 0 10px rgba(255, 255, 255, 0.65),
    0 0 32px rgba(155, 100, 255, 0.78);
  transform: translate(-50%, -50%);
}

.passed-hat {
  right: 17%;
  bottom: 22%;
  transform: rotate(10deg);
}

.star-core {
  position: absolute;
  left: 52%;
  bottom: 28%;
  z-index: 5;
  width: min(24%, 135px);
  aspect-ratio: 1;
  border: 5px solid var(--line);
  border-radius: 50%;
  background:
    radial-gradient(circle at 38% 34%, #ffffff 0 13%, transparent 14%),
    radial-gradient(circle, #fff6a8 0 26%, #c580ff 27% 58%, #5b2ba8 59% 100%);
  box-shadow:
    0 0 0 8px rgba(255, 255, 255, 0.42),
    0 0 30px rgba(176, 107, 255, 0.72);
}

.small-core {
  left: 56%;
  bottom: 28%;
  width: min(17%, 92px);
}

.orbit-core {
  animation: orbit-cookie 2.4s linear infinite;
}

.shadow-shards {
  position: absolute;
  inset: 14% 10% 32%;
  z-index: 4;
}

.shadow-shards span {
  position: absolute;
  width: 4rem;
  aspect-ratio: 0.75;
  border: 4px solid var(--line);
  background: linear-gradient(145deg, #20142f, #7a4ac7);
  clip-path: polygon(50% 0, 100% 36%, 75% 100%, 22% 100%, 0 35%);
  box-shadow: 0 0 14px rgba(128, 71, 208, 0.6);
}

.shadow-shards span:nth-child(1) {
  left: 12%;
  top: 26%;
  transform: rotate(-15deg);
}

.shadow-shards span:nth-child(2) {
  left: 44%;
  top: 2%;
  transform: rotate(8deg);
}

.shadow-shards span:nth-child(3) {
  right: 10%;
  top: 31%;
  transform: rotate(19deg);
}

.rune-wall {
  position: absolute;
  right: 12%;
  bottom: 18%;
  z-index: 4;
  width: min(33%, 190px);
  aspect-ratio: 1.1;
  border: 5px solid var(--line);
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 50%, transparent 0 24%, #ffd84a 25% 28%, transparent 29%),
    linear-gradient(45deg, transparent 0 47%, #8a5cff 48% 52%, transparent 53%),
    linear-gradient(-45deg, transparent 0 47%, #8a5cff 48% 52%, transparent 53%),
    rgba(255, 255, 255, 0.82);
  box-shadow: 0 0 24px rgba(138, 92, 255, 0.65);
}

.dark-book {
  background:
    radial-gradient(circle at 50% 50%, #ffd84a 0 9%, transparent 10%),
    linear-gradient(90deg, #21152f 0 48%, #fffdf4 49% 54%, #5f2da8 55% 100%);
}

@keyframes orbit-cookie {
  from {
    transform: translateX(-50%) rotate(0deg) translateX(1.5rem) rotate(0deg);
  }
  to {
    transform: translateX(-50%) rotate(360deg) translateX(1.5rem) rotate(-360deg);
  }
}

.system-window {
  position: absolute;
  left: 7%;
  top: 8%;
  z-index: 5;
  padding: 0.5rem 0.75rem;
  border: 4px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 4px 4px 0 rgba(32, 32, 32, 0.25);
  font-weight: 900;
}

.weapon-rack {
  position: absolute;
  right: 6%;
  top: 15%;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(5rem, 1fr));
  gap: 0.55rem;
  width: min(58%, 22rem);
}

.weapon-rack span {
  min-height: 3rem;
  display: grid;
  place-items: center;
  border: 4px solid var(--line);
  border-radius: 10px;
  background: #fffdf4;
  box-shadow: 4px 4px 0 rgba(32, 32, 32, 0.16);
  font-weight: 900;
}

.m14-gun {
  position: absolute;
  z-index: 6;
  width: min(42%, 240px);
  height: 1.2rem;
  border: 4px solid var(--line);
  border-radius: 999px;
  background: #373737;
  box-shadow: 4px 5px 0 rgba(32, 32, 32, 0.22);
}

.m14-gun::before {
  content: "";
  position: absolute;
  left: 25%;
  top: 100%;
  width: 22%;
  height: 2rem;
  border: 4px solid var(--line);
  border-top: 0;
  border-radius: 0 0 8px 8px;
  background: #5b3d28;
  transform: skewX(-14deg);
}

.m14-gun::after {
  content: "";
  position: absolute;
  right: -18%;
  top: 16%;
  width: 24%;
  height: 0.45rem;
  border: 3px solid var(--line);
  border-radius: 999px;
  background: #4c4c4c;
}

.selected-gun {
  right: 11%;
  bottom: 24%;
  transform: rotate(-6deg);
}

.held-gun {
  left: 24%;
  bottom: 33%;
  transform: rotate(-4deg);
}

.star-eyes {
  position: absolute;
  left: 21%;
  top: 30%;
  z-index: 8;
  width: 2.2rem;
  height: 2.2rem;
  background: #ffd34f;
  clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 56%, 79% 91%, 50% 70%, 21% 91%, 32% 56%, 2% 35%, 39% 35%);
  filter: drop-shadow(2px 2px 0 #111111);
  box-shadow: 4.6rem 0.2rem 0 #ffd34f;
}

.game-door {
  position: absolute;
  right: 12%;
  bottom: 21%;
  z-index: 1;
  width: min(28%, 150px);
  height: 50%;
  border: 5px solid var(--line);
  border-radius: 12px 12px 0 0;
  background:
    radial-gradient(circle at 82% 52%, #ffd34f 0 5%, transparent 6%),
    linear-gradient(90deg, #af7441, #d59a5c);
  box-shadow: 5px 5px 0 rgba(32, 32, 32, 0.2);
}

.open-door {
  transform: skewY(-4deg);
}

.muzzle-flash {
  position: absolute;
  left: 57%;
  bottom: 38%;
  z-index: 7;
  width: 4.8rem;
  aspect-ratio: 1;
  background: #ffd34f;
  clip-path: polygon(50% 0, 61% 35%, 100% 20%, 72% 50%, 100% 78%, 61% 65%, 50% 100%, 39% 65%, 0 78%, 28% 50%, 0 20%, 39% 35%);
  filter: drop-shadow(3px 3px 0 #111111);
}

.team-label {
  position: absolute;
  right: 17%;
  top: 18%;
  z-index: 6;
  padding: 0.35rem 0.55rem;
  border: 3px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 3px 3px 0 rgba(32, 32, 32, 0.18);
  font-weight: 900;
}

.snack-bag {
  position: absolute;
  right: 17%;
  bottom: 18%;
  z-index: 5;
  width: 5rem;
  height: 6.5rem;
  border: 4px solid var(--line);
  border-radius: 10px 10px 18px 18px;
  background:
    linear-gradient(140deg, rgba(255, 255, 255, 0.35), transparent 30%),
    #ffd34f;
  box-shadow: 5px 5px 0 var(--line);
}

.snack-bag::before {
  content: "";
  position: absolute;
  left: 18%;
  top: 17%;
  width: 64%;
  height: 1rem;
  border: 3px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
}

.training-gate {
  left: 50%;
  bottom: 30%;
  width: 12rem;
  height: 5rem;
  border-radius: 8px 8px 0 0;
  transform: translateX(-50%);
}

.training-cones {
  position: absolute;
  left: 38%;
  right: 8%;
  bottom: 9%;
  z-index: 1;
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
}

.training-cones span {
  width: 2.2rem;
  height: 3.2rem;
  border: 4px solid var(--line);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  background:
    linear-gradient(to bottom, transparent 0 35%, #ffffff 36% 48%, transparent 49% 100%),
    #ff7a2f;
}

.clipboard,
.manual-card {
  position: absolute;
  z-index: 4;
  border: 4px solid var(--line);
  border-radius: 8px;
  background: #fffdf4;
  box-shadow: 5px 5px 0 rgba(32, 32, 32, 0.2);
}

.clipboard {
  left: 25%;
  bottom: 26%;
  width: 5.3rem;
  height: 7rem;
  background:
    linear-gradient(#111111 0 0) 50% 8% / 2.5rem 0.55rem no-repeat,
    repeating-linear-gradient(to bottom, transparent 0 1rem, rgba(32, 32, 32, 0.16) 1rem 1.15rem),
    #fffdf4;
  transform: rotate(-5deg);
}

.flying-paper {
  left: 48%;
  bottom: 44%;
  transform: rotate(18deg);
}

.start-button {
  position: absolute;
  z-index: 5;
  display: grid;
  place-items: center;
  border: 5px solid var(--line);
  border-radius: 999px;
  color: #ffffff;
  background:
    radial-gradient(circle at 38% 28%, rgba(255, 255, 255, 0.88) 0 12%, transparent 13%),
    linear-gradient(145deg, #ff5b4a, #b91717);
  box-shadow:
    inset -8px -12px 0 rgba(0, 0, 0, 0.18),
    6px 8px 0 rgba(32, 32, 32, 0.24);
  font-weight: 900;
  text-shadow: 2px 2px 0 #111111;
}

.big-button {
  right: 9%;
  bottom: 14%;
  width: min(34%, 180px);
  aspect-ratio: 1;
  font-size: clamp(1.1rem, 3vw, 1.65rem);
}

.tiny-button {
  right: 18%;
  bottom: 14%;
  width: 5.4rem;
  aspect-ratio: 1;
  font-size: 1rem;
  transform: rotate(4deg);
}

.broken-button {
  right: 9%;
  bottom: 12%;
  width: min(38%, 210px);
  aspect-ratio: 1.15;
  border-radius: 32% 50% 38% 46%;
  font-size: clamp(1rem, 2.8vw, 1.45rem);
  transform: rotate(-9deg);
}

.pointer-baguette {
  right: 50%;
  bottom: 28%;
  height: 11rem;
  transform: rotate(69deg);
}

.upside-ball {
  transform: rotate(180deg);
}

.speed-yard {
  background:
    linear-gradient(transparent 66%, rgba(70, 70, 70, 0.22) 67%),
    linear-gradient(145deg, #dbe9ff, #fff0b8);
}

.speed-lines {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    repeating-linear-gradient(12deg, transparent 0 1.35rem, rgba(43, 127, 255, 0.28) 1.35rem 1.62rem),
    repeating-linear-gradient(-12deg, transparent 0 1.8rem, rgba(242, 76, 61, 0.18) 1.8rem 2.05rem);
  animation: speed-slide 0.55s linear infinite;
}

.spin-ball {
  animation: spin-wobble 0.7s linear infinite;
}

.manual-card {
  left: 11%;
  top: 12%;
  max-width: 42%;
  padding: 0.65rem 0.8rem;
  font-weight: 900;
  line-height: 1.25;
  transform: rotate(-3deg);
}

@keyframes speed-slide {
  from {
    background-position: 0 0, 0 0;
  }
  to {
    background-position: 4rem 0, -4rem 0;
  }
}

@keyframes spin-wobble {
  from {
    transform: rotate(0deg) scale(0.95);
  }
  to {
    transform: rotate(360deg) scale(0.95);
  }
}

.caption {
  margin: 0;
  padding: 0.85rem 1rem 1rem;
  color: #5f5146;
  font-weight: 700;
  line-height: 1.5;
}

.site-footer {
  display: flex;
  justify-content: center;
  margin: 1rem 0 0;
  padding: 0 0 0.35rem;
  text-align: center;
}

.site-footer span {
  display: inline-flex;
  align-items: center;
  min-height: 2.35rem;
  padding: 0.45rem 0.8rem;
  border: 3px solid var(--line);
  border-radius: 999px;
  color: #59483f;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 3px 3px 0 rgba(32, 32, 32, 0.28);
  font-weight: 900;
}

@keyframes hop {
  0%, 100% {
    transform: translateY(0) rotate(-2deg);
  }
  50% {
    transform: translateY(-14px) rotate(3deg);
  }
}

@media (max-width: 820px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .episode-badge {
    transform: rotate(-2deg);
  }

  .comic-grid {
    grid-template-columns: 1fr;
  }

  .panel-scene {
    min-height: 300px;
  }

  .reader-toolbar {
    position: static;
  }
}

@media (max-width: 520px) {
  .site-header {
    padding-top: 1rem;
  }

  .panel-scene {
    min-height: 250px;
  }

  .character.main {
    width: 58%;
  }

  .character.small {
    width: 38%;
  }

  .caption {
    font-size: 0.92rem;
  }
}

/* 新版漫画集外壳：可爱书架 + 阅读器 */
:root {
  --cream: #fff8e9;
  --pink: #ffd8bf;
  --mint: #d8f6ec;
  --sky: #ffe4c7;
  --lavender: #eee4ff;
}

body {
  background:
    radial-gradient(circle at 12% 12%, rgba(255, 210, 158, 0.78), transparent 20rem),
    radial-gradient(circle at 88% 8%, rgba(255, 184, 140, 0.68), transparent 24rem),
    radial-gradient(circle at 58% 92%, rgba(255, 226, 145, 0.78), transparent 28rem),
    linear-gradient(135deg, #fff8e9 0%, #ffe8c9 48%, #fff1d7 100%);
}

body[data-world="space"] {
  background:
    radial-gradient(circle at 12% 14%, rgba(77, 178, 255, 0.58), transparent 22rem),
    radial-gradient(circle at 86% 10%, rgba(146, 218, 255, 0.72), transparent 24rem),
    radial-gradient(circle at 58% 92%, rgba(119, 158, 255, 0.42), transparent 28rem),
    linear-gradient(135deg, #dff4ff 0%, #eef8ff 48%, #dce8ff 100%);
}

body[data-world="magic"] {
  background:
    radial-gradient(circle at 12% 14%, rgba(181, 132, 255, 0.58), transparent 22rem),
    radial-gradient(circle at 86% 10%, rgba(255, 190, 247, 0.72), transparent 24rem),
    radial-gradient(circle at 58% 92%, rgba(142, 112, 255, 0.36), transparent 28rem),
    linear-gradient(135deg, #f3e5ff 0%, #fff0ff 48%, #e7dcff 100%);
}

.site-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 1.25rem;
}

.app-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: clamp(1rem, 2vw, 1.5rem);
  border: 4px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(110deg, rgba(255, 255, 255, 0.86), rgba(255, 236, 204, 0.96)),
    var(--cream);
  box-shadow: 8px 8px 0 rgba(32, 32, 32, 0.88);
}

.brand-block h1 {
  font-size: clamp(2.1rem, 5vw, 4.7rem);
}

.brand-block .subtitle {
  max-width: 42rem;
  color: #655346;
  font-size: clamp(1rem, 2vw, 1.35rem);
  font-weight: 800;
}

.hero-balls {
  position: relative;
  width: clamp(9rem, 20vw, 17rem);
  height: clamp(6.8rem, 15vw, 12rem);
}

.mini-ball {
  position: absolute;
  display: block;
  width: 42%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(5px 7px 0 rgba(32, 32, 32, 0.16));
}

.hero-balls .mini-ball:nth-child(1) {
  left: 0;
  bottom: 7%;
  transform: rotate(-8deg);
}

.hero-balls .mini-ball:nth-child(2) {
  left: 32%;
  top: 2%;
  transform: rotate(5deg);
}

.hero-balls .mini-ball:nth-child(3) {
  right: 0;
  bottom: 0;
  transform: rotate(10deg);
}

.is-hidden {
  display: none !important;
}

.home-panel {
  display: grid;
  gap: 1rem;
  margin: 1.25rem 0 0;
  padding: clamp(0.95rem, 2vw, 1.35rem);
  border: 4px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 250, 238, 0.93);
  box-shadow: 7px 7px 0 rgba(32, 32, 32, 0.82);
}

.home-head {
  display: grid;
  gap: 0.35rem;
}

.home-intro {
  margin: 0;
  color: #655346;
  font-weight: 800;
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.45rem;
}

.home-head h2 {
  margin: 0;
  font-size: clamp(1.7rem, 4vw, 3rem);
  line-height: 1.05;
}

.home-head p:last-child {
  margin: 0;
  color: #655346;
  font-weight: 800;
}

.wechat-button {
  justify-self: start;
  margin-top: 0.35rem;
  background: #b8f7c8;
}

.home-episode-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.home-guide,
.home-highlight {
  border: 3px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 3px 3px 0 rgba(32, 32, 32, 0.45);
  padding: 0.7rem 0.85rem;
}

.home-guide h3,
.home-highlight h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}

.home-guide ul {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.22rem;
  font-weight: 700;
  color: #5c493d;
}

.home-highlight p {
  margin: 0;
  font-weight: 700;
  color: #5c493d;
}

.home-episode-card {
  min-height: 6.4rem;
}

.advanced-home-card {
  background: linear-gradient(135deg, #fff6c7, #ffe0f1);
}

.advanced-number {
  background: #ffd34f;
  font-size: 0.85rem;
}

.page-layout {
  display: grid;
  grid-template-columns: minmax(16rem, 21rem) minmax(0, 1fr);
  gap: 1.25rem;
  max-width: none;
  margin: 1.25rem 0 0;
  padding: 0;
}

.library-panel,
.reader-panel {
  border: 4px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 250, 238, 0.93);
  box-shadow: 7px 7px 0 rgba(32, 32, 32, 0.82);
}

.library-panel {
  align-self: start;
  position: sticky;
  top: 1rem;
  display: grid;
  gap: 1rem;
  padding: 1rem;
}

.library-section {
  display: grid;
  gap: 0.75rem;
}

.section-kicker {
  margin: 0;
  color: #8b5d2e;
  font-size: 0.85rem;
  font-weight: 900;
}

.library-section h2,
.reader-head h2 {
  margin: 0;
  font-size: clamp(1.25rem, 3vw, 2rem);
  line-height: 1.1;
}

.theme-list {
  display: grid;
  gap: 0.65rem;
}

.episode-list {
  display: grid;
  gap: 0.65rem;
}

.theme-card,
.episode-card {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 4.4rem;
  padding: 0.8rem;
  border: 3px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: #ffffff;
  box-shadow: 4px 4px 0 rgba(32, 32, 32, 0.35);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.theme-card.active,
.episode-card.active {
  background: #ffe5ad;
  box-shadow: 5px 5px 0 var(--line);
}

.episode-card.upcoming {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(255, 224, 186, 0.68));
}

.episode-card.upcoming strong::after {
  content: "待写";
  display: inline-block;
  margin-left: 0.45rem;
  padding: 0.1rem 0.38rem;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  font-size: 0.68rem;
  vertical-align: middle;
}

.theme-card small,
.episode-card small {
  display: block;
  margin-top: 0.18rem;
  color: #6c5a4c;
  font-size: 0.78rem;
  font-weight: 800;
}

.theme-dot,
.episode-number {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 2.5rem;
  aspect-ratio: 1;
  border: 3px solid var(--line);
  border-radius: 50%;
  font-weight: 900;
}

.daily-dot {
  background: var(--yellow);
}

.magic-dot {
  background: var(--lavender);
}

.space-dot {
  background: var(--sky);
}

.episode-number {
  background: var(--mint);
}

.space-number {
  background: var(--sky);
}

.magic-number {
  background: var(--lavender);
}

.reader-panel {
  min-width: 0;
  padding: clamp(0.85rem, 2vw, 1.25rem);
}

body[data-world="space"] .reader-panel,
body[data-world="space"] .library-panel,
body[data-world="space"] .app-header {
  background: rgba(239, 249, 255, 0.94);
}

body[data-world="magic"] .reader-panel,
body[data-world="magic"] .library-panel,
body[data-world="magic"] .app-header {
  background: rgba(252, 244, 255, 0.94);
}

.wechat-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(14, 16, 22, 0.78);
}

.wechat-modal.show {
  display: flex;
}

.advanced-modal {
  position: fixed;
  inset: 0;
  z-index: 65;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(14, 16, 22, 0.78);
}

.advanced-modal.show {
  display: flex;
}

.wechat-card,
.advanced-card {
  width: min(32rem, 100%);
  display: grid;
  gap: 0.85rem;
  padding: clamp(0.85rem, 2vw, 1.2rem);
  border: 4px solid var(--line);
  border-radius: 18px;
  background: #fffdf6;
  box-shadow: 10px 10px 0 rgba(0, 0, 0, 0.7);
}

.advanced-card {
  background:
    radial-gradient(circle at 88% 12%, rgba(255, 211, 79, 0.5), transparent 9rem),
    #fffdf6;
}

.wechat-head,
.advanced-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.wechat-head h2,
.advanced-head h2 {
  margin: 0;
  font-size: clamp(1.45rem, 4vw, 2.3rem);
}

.wechat-qr {
  width: min(100%, 24rem);
  justify-self: center;
  border: 4px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 5px 5px 0 rgba(32, 32, 32, 0.45);
}

.wechat-id,
.wechat-tip {
  margin: 0;
  font-weight: 900;
  text-align: center;
  overflow-wrap: anywhere;
}

.wechat-tip {
  color: #655346;
  font-size: 0.95rem;
}

.advanced-copy,
.advanced-error {
  margin: 0;
  font-weight: 900;
}

.ai-check-card {
  display: grid;
  gap: 0.55rem;
  padding: 0.75rem;
  border: 3px solid var(--line);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(210, 235, 255, 0.86), rgba(255, 246, 204, 0.9)),
    #ffffff;
  box-shadow: 4px 4px 0 rgba(32, 32, 32, 0.32);
}

.ai-check-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
}

.ai-check-question {
  margin: 0;
  padding: 0.55rem 0.65rem;
  border: 2px dashed var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.78);
  font-weight: 900;
  line-height: 1.35;
}

.small-action {
  min-height: 2.45rem;
  padding: 0.45rem 0.6rem;
  font-size: 0.9rem;
}

.password-label {
  font-weight: 900;
}

.password-input {
  width: 100%;
  min-height: 3.1rem;
  padding: 0.6rem 0.75rem;
  border: 3px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: #ffffff;
  box-shadow: 3px 3px 0 rgba(32, 32, 32, 0.35);
  font: inherit;
  font-weight: 900;
}

.advanced-error {
  min-height: 1.4rem;
  color: #b24a3a;
}

.advanced-unlock-button {
  justify-self: start;
  background: #ffd34f;
}

.advanced-generated-scene {
  min-height: 0;
  aspect-ratio: 1122 / 1402;
}

.reader-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.reader-toolbar {
  position: sticky;
  top: 0.75rem;
  margin: 0 0 1rem;
  border-radius: 16px;
}

.comic-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.comic-grid.focus-mode {
  grid-template-columns: minmax(0, 1fr);
}

.comic-panel {
  border-radius: 14px;
  box-shadow: 6px 6px 0 rgba(32, 32, 32, 0.78);
}

.panel-scene {
  min-height: clamp(260px, 25vw, 360px);
}

@media (max-width: 1050px) {
  .page-layout {
    grid-template-columns: 1fr;
  }

  .home-episode-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .library-panel {
    position: static;
  }

  .theme-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .comic-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}

@media (max-width: 720px) {
  .site-shell {
    padding: 0.55rem;
  }

  .app-header {
    grid-template-columns: 1fr;
    gap: 0.35rem;
    padding: 0.85rem;
    border-radius: 12px;
  }

  .hero-balls {
    justify-self: end;
    width: 7.2rem;
    height: 4.8rem;
    margin-top: -0.5rem;
    opacity: 0.9;
  }

  .episode-label {
    margin-bottom: 0.35rem;
    padding: 0.26rem 0.5rem;
    border-width: 2px;
    box-shadow: 2px 2px 0 var(--line);
    font-size: 0.78rem;
  }

  .brand-block h1 {
    font-size: clamp(2rem, 12vw, 3.1rem);
  }

  .brand-block .subtitle {
    margin-top: 0.45rem;
    font-size: 0.98rem;
    line-height: 1.35;
  }

  .page-layout {
    gap: 0.8rem;
    margin-top: 0.8rem;
  }

  .home-panel {
    margin-top: 0.8rem;
    padding: 0.75rem;
    border-radius: 12px;
  }

  .home-actions .comic-button {
    flex: 1 1 10rem;
  }

  .home-episode-grid {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  .home-episode-card {
    min-height: 4.4rem;
  }

  .library-panel,
  .reader-panel {
    border-radius: 12px;
  }

  .library-panel {
    gap: 0.75rem;
    padding: 0.75rem;
  }

  .library-section {
    gap: 0.5rem;
  }

  .library-section h2,
  .reader-head h2 {
    font-size: 1.35rem;
  }

  .theme-list,
  .episode-list {
    display: flex;
    overflow-x: auto;
    padding-bottom: 0.35rem;
    margin-inline: -0.1rem;
    padding-inline: 0.1rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .theme-list::-webkit-scrollbar,
  .episode-list::-webkit-scrollbar {
    display: none;
  }

  .theme-card,
  .episode-card {
    min-width: min(78vw, 17rem);
    min-height: 3.8rem;
    padding: 0.65rem;
    border-radius: 10px;
    scroll-snap-align: start;
  }

  .theme-dot,
  .episode-number {
    width: 2.15rem;
    border-width: 2px;
  }

  .theme-card small,
  .episode-card small {
    font-size: 0.72rem;
  }

  .reader-panel {
    padding: 0.65rem;
  }

  .reader-head {
    align-items: flex-start;
    flex-direction: row;
    gap: 0.6rem;
    margin-bottom: 0.7rem;
  }

  .episode-badge {
    padding: 0.45rem 0.55rem;
    border-width: 3px;
    border-radius: 7px;
    box-shadow: 3px 3px 0 var(--line);
    font-size: 0.78rem;
    line-height: 1.15;
    transform: rotate(2deg);
  }

  .reader-toolbar {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
    padding: 0.65rem;
    border-width: 3px;
    border-radius: 12px;
  }

  .comic-button {
    width: 100%;
    min-width: 0;
    min-height: 2.55rem;
    padding: 0.55rem 0.5rem;
    border-width: 2px;
    box-shadow: 2px 2px 0 var(--line);
    font-size: 0.92rem;
    line-height: 1.15;
  }

  #panelCounter {
    order: -1;
    grid-column: 1 / -1;
    min-width: 0;
    padding: 0.2rem 0;
  }

  .comic-grid,
  .comic-grid.focus-mode {
    grid-template-columns: 1fr;
  }

  .comic-panel {
    border-width: 3px;
    border-radius: 10px;
    box-shadow: 3px 3px 0 rgba(32, 32, 32, 0.78);
  }

  .comic-grid:not(.focus-mode) .panel-scene,
  .comic-grid.focus-mode .panel-scene {
    min-height: min(82vw, 340px);
  }

  .comic-grid:not(.focus-mode) .generated-panel-scene,
  .comic-grid.focus-mode .generated-panel-scene {
    min-height: 0;
    aspect-ratio: auto;
  }

  .comic-grid:not(.focus-mode) .generated-cover-scene,
  .comic-grid.focus-mode .generated-cover-scene {
    min-height: 0;
    aspect-ratio: 1717 / 916;
  }

  .reader-panel .comic-bubble {
    max-width: 68%;
    padding: 0.45rem 0.55rem;
    border-width: 2px;
    border-radius: 12px;
    font-size: 0.85rem;
    line-height: 1.2;
  }

  .reader-panel .comic-bubble::after {
    bottom: -8px;
    width: 14px;
    height: 14px;
    border-right-width: 2px;
    border-bottom-width: 2px;
  }

  .reader-panel .character-img.main {
    width: min(52%, 210px);
  }

  .reader-panel .character-img.small {
    width: min(34%, 135px);
  }
}

@media (max-width: 460px) {
  .comic-button {
    font-size: 0.86rem;
  }

  .panel-scene {
    min-height: 270px;
  }

  .library-panel,
  .reader-panel,
  .app-header {
    border-width: 3px;
    box-shadow: 4px 4px 0 rgba(32, 32, 32, 0.8);
  }

  .site-footer {
    margin-top: 0.75rem;
    padding-bottom: 0.1rem;
  }

  .site-footer span {
    min-height: 2.1rem;
    padding: 0.35rem 0.65rem;
    border-width: 2px;
    box-shadow: 2px 2px 0 rgba(32, 32, 32, 0.25);
    font-size: 0.86rem;
  }

  .reader-head {
    flex-direction: column;
  }

  .episode-badge {
    align-self: flex-start;
  }

  .theme-card,
  .episode-card {
    min-width: min(82vw, 16rem);
  }
}

/* 阅读区清理：减少杂乱感，让角色和对白更清楚 */
.reader-notice {
  min-height: 1.75rem;
  margin: -0.35rem 0 0.85rem;
  color: #b24a3a;
  font-weight: 900;
  text-align: center;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.reader-notice.show {
  opacity: 1;
}

.reader-panel .panel-scene::after {
  opacity: 0;
}

.reader-panel .comic-panel {
  border-width: 4px;
  box-shadow: 4px 4px 0 rgba(32, 32, 32, 0.72);
}

.reader-panel .panel-scene {
  border-bottom: 0;
}

.reader-panel .comic-bubble {
  max-width: 48%;
  overflow-wrap: anywhere;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.12);
}

.reader-panel .character-img {
  --pose-rotate: 0deg;
  --pose-scale: 1;
  max-height: 80%;
  filter: drop-shadow(0 8px 0 rgba(0, 0, 0, 0.1));
  transform-origin: 50% 82%;
}

.reader-panel .character-img.tilt {
  --pose-rotate: -8deg;
}

.reader-panel .character-img.main {
  width: min(46%, 275px);
}

.reader-panel .character-img.small {
  width: min(29%, 165px);
}

.reader-panel .character-img.tiny {
  width: min(19%, 105px);
}

.comic-grid:not(.focus-mode) .panel-scene {
  min-height: clamp(230px, 20vw, 300px);
}

.comic-grid.focus-mode .panel-scene {
  min-height: clamp(360px, 45vw, 560px);
}

.comic-grid:not(.focus-mode) .generated-panel-scene {
  min-height: 0;
  aspect-ratio: auto;
}

.comic-grid.focus-mode .generated-panel-scene {
  min-height: 0;
  aspect-ratio: auto;
}

.comic-grid:not(.focus-mode) .generated-cover-scene,
.comic-grid.focus-mode .generated-cover-scene {
  min-height: 0;
  aspect-ratio: 1717 / 916;
}

.comic-grid:not(.focus-mode) .cover-label {
  max-width: 76%;
  padding: 0.35rem 0.55rem;
  font-size: clamp(0.86rem, 1.25vw, 1.05rem);
  line-height: 1.15;
  text-align: center;
}

@media (max-width: 720px) {
  .reader-panel .comic-panel {
    border-width: 3px;
    border-radius: 10px;
    box-shadow: 3px 3px 0 rgba(32, 32, 32, 0.78);
  }

  .reader-panel .comic-bubble {
    max-width: 68%;
    padding: 0.45rem 0.55rem;
    border-width: 2px;
    border-radius: 12px;
    font-size: 0.85rem;
    line-height: 1.2;
  }

  .reader-panel .comic-bubble::after {
    bottom: -8px;
    width: 14px;
    height: 14px;
    border-right-width: 2px;
    border-bottom-width: 2px;
  }

  .reader-panel .character-img.main {
    width: min(52%, 210px);
  }

  .reader-panel .character-img.small {
    width: min(34%, 135px);
  }

  .comic-grid.focus-mode .panel-scene {
    min-height: min(82vw, 340px);
  }

  .comic-grid.focus-mode .generated-panel-scene,
  .comic-grid.focus-mode .generated-cover-scene {
    min-height: 0;
  }
}

@media (max-width: 460px) {
  .reader-panel .comic-panel {
    box-shadow: 3px 3px 0 rgba(32, 32, 32, 0.76);
  }
}

.character-img.eyes-happy {
  animation: happy-smile 2.1s ease-in-out infinite;
}

.character-img.eyes-angry {
  animation: angry-shake 1.35s steps(2, end) infinite;
}

.character-img.eyes-worried {
  animation: worried-sway 1.9s ease-in-out infinite;
}

.character-img.eyes-focused {
  animation: focused-lean 2.4s ease-in-out infinite;
}

.character-img.eyes-cool {
  animation: cool-nod 3s ease-in-out infinite;
}

@keyframes happy-smile {
  0%, 100% {
    transform: rotate(var(--pose-rotate)) scale(var(--pose-scale));
  }
  50% {
    transform: rotate(calc(var(--pose-rotate) + 2deg)) scale(1.015);
  }
}

@keyframes angry-shake {
  0%, 100% {
    transform: translateX(0) rotate(var(--pose-rotate)) scale(var(--pose-scale));
  }
  25% {
    transform: translateX(-3px) rotate(calc(var(--pose-rotate) - 2deg)) scale(var(--pose-scale));
  }
  75% {
    transform: translateX(3px) rotate(calc(var(--pose-rotate) + 2deg)) scale(var(--pose-scale));
  }
}

@keyframes worried-sway {
  0%, 100% {
    transform: translateX(0) rotate(var(--pose-rotate)) scale(var(--pose-scale));
  }
  50% {
    transform: translateX(5px) rotate(calc(var(--pose-rotate) + 1deg)) scale(var(--pose-scale));
  }
}

@keyframes focused-lean {
  0%, 100% {
    transform: rotate(var(--pose-rotate)) scale(var(--pose-scale));
  }
  50% {
    transform: rotate(calc(var(--pose-rotate) - 3deg)) scale(1.01);
  }
}

@keyframes cool-nod {
  0%, 100% {
    transform: rotate(var(--pose-rotate)) scale(var(--pose-scale));
  }
  50% {
    transform: rotate(calc(var(--pose-rotate) + 1.5deg)) scale(var(--pose-scale));
  }
}

@media (prefers-reduced-motion: reduce) {
  .character-img.eyes-happy,
  .character-img.eyes-angry,
  .character-img.eyes-worried,
  .character-img.eyes-focused,
  .character-img.eyes-cool {
    animation: none;
  }
}

.comic-grid:not(.focus-mode) .square-generated-scene,
.comic-grid.focus-mode .square-generated-scene {
  aspect-ratio: auto;
}

.comic-grid:not(.focus-mode) .wide-generated-scene,
.comic-grid.focus-mode .wide-generated-scene {
  aspect-ratio: auto;
}

.comic-grid:not(.focus-mode) .ultra-wide-generated-scene,
.comic-grid.focus-mode .ultra-wide-generated-scene {
  aspect-ratio: auto;
}

/* Cleaner reader layout: keep the comic as the main focus. */
.site-shell {
  width: min(1240px, 100%);
}

.app-header {
  padding: 0.95rem 1.1rem;
  border-radius: 14px;
  box-shadow: 5px 5px 0 rgba(32, 32, 32, 0.76);
}

.brand-block h1 {
  font-size: clamp(1.9rem, 4.2vw, 3.7rem);
}

.brand-block .subtitle {
  margin-top: 0.45rem;
  font-size: clamp(0.95rem, 1.5vw, 1.12rem);
}

.hero-balls {
  width: clamp(7rem, 13vw, 10.5rem);
  height: clamp(5rem, 9vw, 7.2rem);
}

.home-panel {
  max-width: 980px;
  margin-inline: auto;
  padding: 1rem;
  border-radius: 14px;
  box-shadow: 5px 5px 0 rgba(32, 32, 32, 0.76);
}

.home-head h2 {
  font-size: clamp(1.45rem, 3vw, 2.2rem);
}

.page-layout {
  grid-template-columns: minmax(13rem, 16rem) minmax(0, 1fr);
  gap: 1rem;
  max-width: 1120px;
  margin: 1rem auto 0;
}

.library-panel,
.reader-panel {
  border-radius: 14px;
  box-shadow: 5px 5px 0 rgba(32, 32, 32, 0.74);
}

.library-panel {
  padding: 0.8rem;
}

.episode-list {
  gap: 0.5rem;
}

.episode-card {
  min-height: 3.75rem;
  padding: 0.62rem;
  border-radius: 10px;
}

.episode-number {
  width: 2.15rem;
}

.reader-panel {
  padding: 0.9rem;
}

.reader-head {
  margin-bottom: 0.7rem;
}

.reader-head h2 {
  font-size: clamp(1.25rem, 2vw, 1.65rem);
}

.episode-badge {
  padding: 0.55rem 0.7rem;
  border-radius: 7px;
  box-shadow: 3px 3px 0 var(--line);
  font-size: 0.9rem;
}

.reader-toolbar {
  position: static;
  justify-content: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  padding: 0.55rem;
  border-radius: 12px;
  box-shadow: 3px 3px 0 rgba(32, 32, 32, 0.34);
}

.comic-button {
  min-height: 2.35rem;
  padding: 0.46rem 0.72rem;
  border-radius: 7px;
  font-size: 0.92rem;
  box-shadow: 2px 2px 0 var(--line);
}

#panelCounter {
  min-width: 6rem;
  font-size: 0.92rem;
}

.comic-stage {
  max-width: 920px;
  margin: 0 auto;
}

.comic-grid {
  gap: 0.75rem;
}

.comic-grid.focus-mode {
  justify-items: center;
}

.comic-grid.focus-mode .comic-panel {
  width: min(760px, 100%);
}

.comic-grid:not(.focus-mode) .comic-panel {
  max-width: 100%;
}

.reader-panel .comic-panel {
  border-width: 3px;
  border-radius: 10px;
  box-shadow: 3px 3px 0 rgba(32, 32, 32, 0.66);
}

.comic-grid:not(.focus-mode) .panel-scene {
  min-height: clamp(190px, 16vw, 250px);
}

.comic-grid.focus-mode .panel-scene {
  min-height: clamp(280px, 34vw, 430px);
}

.comic-grid.focus-mode .square-generated-scene {
  max-height: none;
}

.comic-grid:not(.focus-mode) .generated-panel-scene,
.comic-grid.focus-mode .generated-panel-scene {
  min-height: 0;
  aspect-ratio: auto;
}

.reader-panel .casino-generated-scene {
  min-height: 0 !important;
  aspect-ratio: 512 / 341 !important;
  height: auto !important;
}

/* Match the generated-image episodes to the smaller visual scale of the casino chapter. */
#episodeOne.focus-mode .comic-panel,
#episodeTwo.focus-mode .comic-panel,
#episodeThree.focus-mode .comic-panel {
  width: min(620px, 100%);
}

#episodeTwo.focus-mode .comic-panel,
#episodeThree.focus-mode .comic-panel {
  width: min(540px, 100%);
}

#episodeOne:not(.focus-mode),
#episodeTwo:not(.focus-mode),
#episodeThree:not(.focus-mode) {
  max-width: 860px;
  justify-self: center;
  margin-inline: auto;
}

#episodeOne:not(.focus-mode) .comic-panel,
#episodeTwo:not(.focus-mode) .comic-panel,
#episodeThree:not(.focus-mode) .comic-panel {
  box-shadow: 2px 2px 0 rgba(32, 32, 32, 0.62);
}

/* All-panels mode readability: smaller bubbles + more room to avoid clipping. */
.reader-panel .comic-grid:not(.focus-mode) .panel-scene {
  min-height: clamp(220px, 20vw, 300px);
}

.reader-panel .comic-grid:not(.focus-mode) .comic-bubble {
  max-width: 44%;
  padding: 0.34rem 0.5rem;
  border-width: 2px;
  border-radius: 11px;
  font-size: clamp(0.73rem, 0.66vw, 0.84rem);
  line-height: 1.18;
  box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.12);
  overflow-wrap: anywhere;
}

.reader-panel .comic-grid:not(.focus-mode) .comic-bubble::after {
  bottom: -7px;
  width: 12px;
  height: 12px;
  border-right-width: 2px;
  border-bottom-width: 2px;
}

.reader-panel .comic-grid:not(.focus-mode) .small-bubble {
  max-width: 36%;
}

.reader-panel .comic-grid:not(.focus-mode) .top-left {
  top: 4.5%;
  left: 4.5%;
}

.reader-panel .comic-grid:not(.focus-mode) .top-right {
  top: 4.5%;
  right: 4.5%;
}

/* Episode 1 all-panels: fill frame to remove gray blank area. */
#episodeOne:not(.focus-mode) .generated-panel-scene {
  min-height: 0;
  aspect-ratio: 1717 / 916;
}

#episodeOne:not(.focus-mode) .generated-panel-scene .panel-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#episodeOne:not(.focus-mode) .generated-panel-scene .comic-bubble {
  max-width: 40%;
  font-size: clamp(0.7rem, 0.6vw, 0.8rem);
}

@media (max-width: 1050px) {
  .page-layout {
    max-width: 900px;
  }

  .library-panel {
    position: static;
  }

  .episode-list {
    display: flex;
    overflow-x: auto;
    padding-bottom: 0.35rem;
    scrollbar-width: none;
  }

  .episode-list::-webkit-scrollbar {
    display: none;
  }

  .episode-card {
    min-width: min(62vw, 15rem);
  }

  .comic-stage {
    max-width: 780px;
  }
}

@media (max-width: 720px) {
  .site-shell {
    padding: 0.55rem;
  }

  .app-header {
    padding: 0.75rem;
  }

  .hero-balls {
    display: none;
  }

  .home-panel,
  .reader-panel,
  .library-panel {
    box-shadow: 3px 3px 0 rgba(32, 32, 32, 0.7);
  }

  .reader-toolbar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .comic-grid.focus-mode .comic-panel,
  .comic-stage {
    width: 100%;
    max-width: 100%;
  }

  .comic-grid.focus-mode .panel-scene {
    min-height: min(68vw, 300px);
  }
}

/* Cleaner home page: compact library first, extra tools second. */
.home-panel {
  grid-template-columns: minmax(0, 1fr);
  gap: 0.85rem;
  max-width: 900px;
}

.home-head {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 0.75rem 1rem;
  padding-bottom: 0.7rem;
  border-bottom: 3px solid rgba(32, 32, 32, 0.18);
}

.home-head .section-kicker,
.home-head h2,
.home-intro {
  grid-column: 1;
}

.home-head h2 {
  font-size: clamp(1.55rem, 3vw, 2.15rem);
}

.home-intro {
  max-width: 34rem;
  font-size: 0.98rem;
  line-height: 1.45;
}

.home-actions {
  grid-column: 2;
  grid-row: 1 / span 3;
  align-self: center;
  justify-content: end;
  margin-top: 0;
}

.home-actions .comic-button {
  min-height: 2.3rem;
  padding: 0.45rem 0.7rem;
  white-space: nowrap;
}

.home-section-title {
  margin: 0.1rem 0 -0.2rem;
  font-size: 1rem;
  line-height: 1.2;
}

.home-quick-section {
  display: grid;
  gap: 0.55rem;
  padding: 0.65rem;
  border: 3px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.58);
}

.home-quick-section .home-section-title {
  margin: 0;
}

.home-quick-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.home-quick-grid .comic-button {
  width: 100%;
}

.home-episode-grid {
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 0.65rem;
}

.home-episode-card {
  min-height: 4.25rem;
  padding: 0.65rem;
  border-radius: 10px;
}

.home-episode-card strong {
  font-size: 0.98rem;
  line-height: 1.15;
}

.home-episode-card small {
  font-size: 0.74rem;
  line-height: 1.25;
}

.home-episode-card .episode-number {
  width: 2.2rem;
  border-width: 2px;
  font-size: 0.88rem;
}

.home-afterword {
  display: grid;
  gap: 0.4rem;
  padding: 0.85rem;
  border: 3px solid var(--line);
  border-radius: 12px;
  background: #fffdf6;
  box-shadow: 3px 3px 0 rgba(32, 32, 32, 0.18);
}

.home-afterword h3 {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.2;
}

.home-afterword p {
  margin: 0;
  color: #5f5045;
  font-size: 0.94rem;
  font-weight: 750;
  line-height: 1.55;
}

.home-afterword .section-kicker {
  margin-bottom: 0.1rem;
  color: var(--ink);
}

.advanced-home-card {
  background: #fff8e9;
}

.advanced-home-card .episode-number {
  background: #ffd34f;
}

@media (max-width: 720px) {
  .home-head {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .home-actions {
    grid-column: 1;
    grid-row: auto;
    justify-content: stretch;
    width: 100%;
  }

  .home-actions .comic-button {
    flex: 1 1 9rem;
  }

  .home-episode-grid {
    grid-template-columns: 1fr;
  }

  .home-quick-grid {
    grid-template-columns: 1fr;
  }
}

/* Final mobile override: later cleanup rules above can otherwise squeeze the
   reader into two columns on phones. Keep phones as a single reading column. */
@media (max-width: 760px) {
  html,
  body {
    width: 100%;
    overflow-x: hidden;
  }

  .site-shell {
    width: 100%;
    padding: 0.5rem;
  }

  .app-header {
    display: block;
    padding: 0.7rem;
    border-width: 3px;
    border-radius: 12px;
  }

  .brand-block h1 {
    font-size: clamp(2rem, 11vw, 3rem);
    line-height: 1.05;
  }

  .brand-block .subtitle {
    font-size: 0.95rem;
    line-height: 1.35;
  }

  .page-layout {
    display: flex;
    flex-direction: column;
    max-width: none;
    width: 100%;
    margin: 0.75rem 0 0;
  }

  .library-panel,
  .reader-panel {
    width: 100%;
    max-width: none;
    border-width: 3px;
    border-radius: 12px;
  }

  .library-panel {
    position: static;
    order: 2;
    margin-bottom: 0.75rem;
    padding: 0.65rem;
  }

  .reader-panel {
    order: 1;
    padding: 0.65rem;
    margin-bottom: 0.75rem;
  }

  .episode-list {
    display: flex;
    overflow-x: auto;
    gap: 0.55rem;
    padding: 0.05rem 0.1rem 0.4rem;
    scroll-snap-type: x mandatory;
  }

  .episode-list .episode-card {
    flex: 0 0 min(78vw, 17rem);
    min-width: 0;
    min-height: 3.65rem;
    scroll-snap-align: start;
  }

  .reader-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.5rem;
    margin-bottom: 0.5rem;
  }

  .reader-kicker {
    font-size: 0.82rem;
  }

  .reader-title {
    font-size: clamp(1.45rem, 8vw, 2rem);
    line-height: 1.05;
  }

  .episode-badge {
    justify-self: start;
    max-width: 100%;
    transform: rotate(-1deg);
  }

  .reader-toolbar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    width: 100%;
    padding: 0.55rem;
  }

  #panelCounter {
    grid-column: 1 / -1;
    min-width: 0;
    order: -1;
  }

  .comic-button {
    width: 100%;
    min-width: 0;
    white-space: normal;
    writing-mode: horizontal-tb;
    word-break: keep-all;
    overflow-wrap: normal;
    line-height: 1.15;
  }

  .comic-stage,
  .comic-grid.focus-mode .comic-panel,
  .comic-grid:not(.focus-mode) {
    width: 100%;
    max-width: none;
  }

  .comic-grid,
  .comic-grid.focus-mode {
    grid-template-columns: 1fr;
    justify-items: stretch;
  }

  .comic-grid.focus-mode .comic-panel {
    justify-self: stretch;
  }

  .comic-grid.focus-mode .panel-scene,
  .comic-grid:not(.focus-mode) .panel-scene {
    min-height: 0;
  }

  .comic-grid.focus-mode .generated-panel-scene,
  .comic-grid:not(.focus-mode) .generated-panel-scene {
    aspect-ratio: 3 / 2;
  }

  .comic-grid.focus-mode .square-generated-scene,
  .comic-grid:not(.focus-mode) .square-generated-scene {
    aspect-ratio: 1 / 1;
  }

  .comic-grid.focus-mode .wide-generated-scene,
  .comic-grid:not(.focus-mode) .wide-generated-scene {
    aspect-ratio: 3 / 2;
  }

  .comic-grid.focus-mode .ultra-wide-generated-scene,
  .comic-grid:not(.focus-mode) .ultra-wide-generated-scene {
    aspect-ratio: 16 / 9;
  }

  .panel-art {
    object-fit: cover;
  }
}

@media (max-width: 430px) {
  .site-shell {
    padding: 0.4rem;
  }

  .app-header,
  .reader-panel,
  .library-panel {
    border-radius: 10px;
  }

  .reader-toolbar {
    padding: 0.45rem;
    gap: 0.42rem;
  }

  .comic-button {
    min-height: 2.35rem;
    padding: 0.45rem 0.5rem;
    font-size: 0.86rem;
  }

  .comic-panel {
    padding: 0.16rem;
  }

  .comic-bubble {
    max-width: 74%;
    padding: 0.38rem 0.48rem;
    font-size: 0.78rem;
    line-height: 1.2;
  }
}

/* Home + selector page cleanup (2026-05-17) */
.home-meta-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.home-meta-strip p {
  margin: 0;
  padding: 0.55rem 0.7rem;
  border: 3px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  color: #564438;
  font-size: 0.92rem;
  font-weight: 700;
}

.home-notice {
  min-height: 1.2rem;
  margin: -0.25rem 0 0;
  color: #7a2d1f;
  font-size: 0.9rem;
  font-weight: 900;
  opacity: 0;
  transition: opacity 160ms ease;
}

.home-notice.show {
  opacity: 1;
}

.library-note {
  margin: -0.2rem 0 0;
  color: #655346;
  font-size: 0.9rem;
  font-weight: 700;
}

.quick-jump h3 {
  margin: 0;
  font-size: 1rem;
}

.quick-jump-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}

.quick-jump-row .comic-button {
  width: 100%;
}

@media (max-width: 1050px) {
  .home-meta-strip {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .home-meta-strip p {
    font-size: 0.88rem;
  }

  .quick-jump-row {
    grid-template-columns: 1fr;
  }
}

/* Generated comic images must keep their own image ratio in single and expanded views. */
.reader-panel .generated-panel-scene,
.comic-grid.focus-mode .generated-panel-scene,
.comic-grid:not(.focus-mode) .generated-panel-scene,
.comic-grid.focus-mode .square-generated-scene,
.comic-grid:not(.focus-mode) .square-generated-scene,
.comic-grid.focus-mode .wide-generated-scene,
.comic-grid:not(.focus-mode) .wide-generated-scene,
.comic-grid.focus-mode .ultra-wide-generated-scene,
.comic-grid:not(.focus-mode) .ultra-wide-generated-scene {
  aspect-ratio: auto !important;
  min-height: 0 !important;
  height: auto !important;
}

.reader-panel .generated-panel-scene .panel-art,
.comic-grid.focus-mode .generated-panel-scene .panel-art,
.comic-grid:not(.focus-mode) .generated-panel-scene .panel-art {
  position: relative !important;
  inset: auto !important;
  display: block !important;
  width: 100% !important;
  height: auto !important;
  object-fit: contain !important;
}

/* In expanded reading, every panel in the same row should be the same size. */
.reader-panel .comic-grid:not(.focus-mode) {
  align-items: stretch;
}

.reader-panel .comic-grid:not(.focus-mode) .comic-panel {
  height: 100%;
}

.reader-panel .comic-grid:not(.focus-mode) .generated-panel-scene {
  height: 100% !important;
  min-height: clamp(220px, 20vw, 300px) !important;
}

.reader-panel .comic-grid:not(.focus-mode) .generated-panel-scene .panel-art {
  position: absolute !important;
  inset: 0 !important;
  height: 100% !important;
  object-fit: cover !important;
}

.image-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 1rem;
  background:
    radial-gradient(circle at 20% 18%, rgba(255, 211, 79, 0.55), transparent 16rem),
    radial-gradient(circle at 82% 22%, rgba(92, 170, 255, 0.42), transparent 18rem),
    linear-gradient(135deg, rgba(255, 248, 233, 0.96), rgba(255, 232, 201, 0.98));
  transition: opacity 0.32s ease, visibility 0.32s ease;
}

.image-loading-overlay.is-done {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.image-loading-card {
  width: min(440px, 100%);
  padding: clamp(1rem, 4vw, 1.45rem);
  border: 4px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 8px 8px 0 rgba(32, 32, 32, 0.84);
}

.image-loading-card h2 {
  margin: 0 0 1rem;
  font-size: clamp(1.35rem, 6vw, 2rem);
  line-height: 1.12;
}

.image-loading-track {
  height: 1.15rem;
  overflow: hidden;
  border: 3px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
}

.image-loading-bar {
  width: 0%;
  height: 100%;
  border-right: 3px solid var(--line);
  background:
    repeating-linear-gradient(
      45deg,
      rgba(255, 255, 255, 0.22) 0 8px,
      transparent 8px 16px
    ),
    linear-gradient(90deg, var(--yellow), #ff8f61, var(--blue));
  transition: width 0.18s ease;
}

.image-loading-main,
.image-loading-speed {
  margin: 0.72rem 0 0;
  font-weight: 900;
}

.image-loading-speed {
  color: #655346;
}

/* Episode 1 panels 3 and 8 are wide images, so they keep their own ratio and must not be cropped. */
#episodeOne:not(.focus-mode) .comic-panel[data-panel="3"],
#episodeOne:not(.focus-mode) .comic-panel[data-panel="8"] {
  grid-column: span 2;
}

#episodeOne .comic-panel[data-panel="3"] .generated-panel-scene,
#episodeOne .comic-panel[data-panel="8"] .generated-panel-scene {
  position: relative !important;
  aspect-ratio: 1717 / 916 !important;
  height: auto !important;
  min-height: 0 !important;
  overflow: visible;
}

#episodeOne .comic-panel[data-panel="3"] .generated-panel-scene .panel-art,
#episodeOne .comic-panel[data-panel="8"] .generated-panel-scene .panel-art {
  position: relative !important;
  inset: auto !important;
  width: 100% !important;
  height: auto !important;
  object-fit: contain !important;
}

@media (max-width: 760px) {
  #episodeOne:not(.focus-mode) .comic-panel[data-panel="3"],
  #episodeOne:not(.focus-mode) .comic-panel[data-panel="8"] {
    grid-column: auto;
  }
}
