.story-page {
  --story-line: #89b6e842;
  --story-ice: #a1d9ff;
  display: grid;
  gap: clamp(28px, 5vw, 72px);
  padding-bottom: 32px;
}
.story-intro { padding-block: clamp(22px, 5vw, 72px) 7px; }
.story-intro h1 {
  font-size: clamp(2.5rem, 7.1vw, 6.5rem);
  line-height: 1;
  letter-spacing: -.065em;
  text-wrap: balance;
}
.story-intro h1 span { display: block; color: var(--story-ice); }
.story-intro p { margin-top: 14px; max-width: 51ch; font-size: clamp(.98rem, 2vw, 1.2rem); }
.story-index { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.story-index a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 7px;
  padding-inline: 11px;
  border: 1px solid var(--story-line);
  border-radius: 9px;
  color: #d3e8ff;
  font-size: .88rem;
  font-weight: 750;
}
.story-index a:is(:hover,:focus-visible) { background: #18304f; }
.story-index svg { color: var(--story-ice); }
.story {
  --scene-accent: #83d1ff;
  display: grid;
  align-items: center;
  gap: clamp(16px, 4.2vw, 67px);
  padding-block: clamp(14px, 3vw, 32px) 0;
  border-top: 1px solid var(--story-line);
  scroll-margin-top: 14px;
}
.story-edited { --scene-accent: #96e2df; }
.story-photo { --scene-accent: #bfc7ff; }
.story-copy h2 { font-size: clamp(1.85rem, 4vw, 3.4rem); line-height: 1.06; letter-spacing: -.052em; }
.story-copy p { margin-top: 10px; max-width: 43ch; }
.treasure-marker { position: relative; width: fit-content; margin: 10px auto 0 clamp(0px, 4vw, 36px); }
.treasure-marker summary {
  display: grid; place-items: center; width: 44px; height: 44px;
  list-style: none; cursor: pointer; border-radius: 10px;
}
.treasure-marker summary::-webkit-details-marker { display: none; }
.treasure-marker summary:focus-visible { outline: 2px solid var(--story-ice); outline-offset: 2px; }
.treasure-illustration {
  position: relative; display: block; width: 48px; height: 45px;
  transform: scale(.42); opacity: .72;
}
.treasure-marker summary:is(:hover, :focus-visible) .treasure-illustration,
.treasure-marker[open] .treasure-illustration { opacity: 1; }
.treasure-cloud {
  position: absolute; inset: auto 2px 3px; height: 25px;
  background:
    radial-gradient(ellipse at 20% 68%, #e9f8fd 0 26%, transparent 29%),
    radial-gradient(ellipse at 47% 55%, #f8fdff 0 37%, transparent 40%),
    radial-gradient(ellipse at 77% 68%, #bad9f3 0 27%, transparent 30%);
  filter: drop-shadow(0 3px 4px #071224a3);
}
.treasure-box {
  position: absolute; width: 24px; height: 18px; left: 12px; bottom: 12px;
  border-radius: 3px 3px 5px 5px;
  background: linear-gradient(90deg, transparent 39%, #df3136 39% 60%, transparent 60%),
              linear-gradient(152deg, #fff297, #ffc436 52%, #df8106);
  box-shadow: 0 2px 3px #55290070, inset -2px -2px #9e58094f;
  transform: rotate(-13deg);
}
.treasure-box::before {
  content: ""; position: absolute; inset: -2px -2px auto; height: 6px; border-radius: 3px;
  background: linear-gradient(90deg, transparent 39%, #e83d40 39% 60%, transparent 60%),
              linear-gradient(#fff59c, #ffc638);
  box-shadow: 0 1px 2px #7d3a2a78;
}
.treasure-bow { position: absolute; top: -8px; left: 6px; width: 12px; height: 8px; }
.treasure-bow::before, .treasure-bow::after {
  content: ""; position: absolute; width: 7px; height: 6px;
  border: 2px solid #f1404d; border-radius: 8px 8px 2px 8px;
  box-shadow: 0 1px 0 #811d3b;
}
.treasure-bow::before { left: -3px; transform: rotate(24deg); }
.treasure-bow::after { right: -3px; transform: scaleX(-1) rotate(24deg); }
.treasure-card {
  position: absolute; z-index: 5; inset-inline-start: 0; bottom: calc(100% + 7px);
  display: grid; gap: 8px; padding: 15px; width: min(270px, calc(100vw - 48px));
  border: 1px solid #527caa; border-radius: 14px; background: #111e31;
  box-shadow: 0 14px 48px #02060ac7;
}
.treasure-card strong { color: #e3f4ff; font-size: 1.1rem; }
.treasure-card p { margin: 0; color: #c2d7f0; font-size: .86rem; line-height: 1.45; }
.treasure-card code { color: #fff1b4; overflow-wrap: anywhere; }
.treasure-card a { color: #99d8ff; font-weight: 750; }
.story-player {
  min-width: 0;
  margin: 0;
  overflow: clip;
  border: 1px solid #7db7f655;
  border-radius: 20px;
  background: #0d1b2d;
  box-shadow: 0 15px 36px #02071062;
}
.story-player figcaption {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 51px;
  padding: 8px 13px;
  background: #14253b;
  border-bottom: 1px solid #8eb6ec32;
}
.story-player figcaption strong { color: #f0f8ff; }
.story-player figcaption small { display: block; color: #b1cbdf; font-size: .72rem; }
.story-avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 50%;
  background: linear-gradient(150deg,#36658b,#244264);
  color: #e5f8ff;
  font-weight: 800;
}
.story-frame {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 12px;
  background: radial-gradient(ellipse at 16% 25%, #1b3350, #101d30 70%);
}
.story-chat { order: 1; display: grid; align-content: end; gap: 6px; min-height: 9.25rem; margin: 0; padding: 0; list-style: none; }
.story-chat [data-slot="1"] { grid-area: 1 / 1; }
.story-chat [data-slot="2"] { grid-area: 2 / 1; }
.story-chat [data-slot="3"] { grid-area: 3 / 1; }
.story-chat [data-slot="4"] { grid-area: 4 / 1; }
.story-photo .story-chat { min-height: 12.75rem; }
.chat-bubble {
  justify-self: start;
  max-width: 82%;
  padding: 7px 10px;
  border-radius: 12px 12px 12px 4px;
  color: #f4f9ff;
  background: #233a54;
  font-size: .91rem;
  line-height: 1.4;
}
.chat-bubble.outgoing { justify-self: end; border-radius: 12px 12px 4px 12px; background: #22518a; }
.chat-bubble small { display: block; color: #c5d9ed; font-size: .72rem; margin-top: 4px; }
.chat-event { justify-self: center; color: #bdd2e9; font-size: .78rem; padding: 4px 11px; border: 1px dashed #79afe75a; border-radius: 20px; }
.scene-notify {
  order: 0;
  margin: 0 auto;
  padding: 10px 12px;
  width: min(100%, 340px);
  border: 1px solid #7cb6ee92;
  border-radius: 13px;
  background: linear-gradient(142deg,#254465,#182d48);
  color: #f0f7ff;
  box-shadow: 0 10px 25px #03080f7a;
  scroll-margin-top: 12px;
}
.scene-notify header { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; color: #d6eaff; font-size: .84rem; }
.scene-notify header img { border-radius: 50%; }
.scene-notify header svg { color: var(--scene-accent); }
.scene-event { margin: 5px 0 7px; color: #f2f7ff; font-weight: 800; font-size: .92rem; }
.scene-notify blockquote { margin: 0; padding: 6px 9px; border-inline-start: 2px solid var(--scene-accent); background: #38638b75; font-size: .88rem; }
.scene-notify > small { display: block; margin-top: 4px; color: #c8ddf0; }
.bot-revisions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; margin: 0; }
.bot-revisions div { padding: 6px 8px; border-radius: 7px; background: #293e57; }
.bot-revisions div + div { background: #25545d; }
.bot-revisions dt { color: #c8dced; font-size: .72rem; }
.bot-revisions dd { margin: 0; color: #f5faff; font-size: .84rem; }
.chat-media { width: 153px; padding: 5px 7px; }
.chat-once, .chat-photo { position: relative; overflow: hidden; aspect-ratio: 16/9; border-radius: 8px; background: #101c30; }
.chat-once img, .chat-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.chat-once img { filter: blur(8px) brightness(.65); }
.chat-once i { position: absolute; inset: 50% auto auto 50%; transform: translate(-50%,-50%); display: grid; place-items: center; width: 24px; height: 24px; border: 1px solid; border-radius: 50%; background: #12243cc9; font-style: normal; }
.chat-photo { width: min(100%, 186px); }
.chat-quote { display: grid; gap: 2px; padding: 2px 7px; margin-bottom: 4px; border-inline-start: 2px solid #badaff; font-size: .75rem; }
.chat-quote span { color: #c5dcf5; }
.story-player [data-visible="false"] { opacity: 0; visibility: hidden; pointer-events: none; }
.story-frame[data-fading] :is(.story-chat, .scene-notify) { opacity: 0; }
.story-footer { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; }
.story-footer p { display: flex; gap: 9px; max-width: 63ch; }
.story-footer svg { flex: none; color: var(--story-ice); }
@media (min-width: 820px) {
  .story { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); }
  .story-player { width: min(100%, 500px); justify-self: end; }
  .story-frame { padding-inline: 17px; }
}
@media (prefers-reduced-motion: no-preference) {
  .treasure-marker:not([open]) .treasure-illustration { animation: treasure-float 4s ease-in-out infinite; }
  @keyframes treasure-float {
    50% { transform: translateY(-2px) rotate(4deg) scale(.42); }
  }
  .story-player [data-at] {
    transition: opacity .46s ease-in-out, transform .58s cubic-bezier(.22,.75,.24,1), visibility 0s;
  }
  .story-player [data-visible="false"] { transform: translateY(10px); transition-delay: 0s, 0s, .46s; }
  .story-player .scene-notify[data-visible="false"] { transform: translateY(-16px) scale(.98); }
  .story-chat { transition: opacity .56s ease-in-out; }
}
