.saga-character-section {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.saga-character-section--classic {
  background: linear-gradient(180deg, #f8f0dc, #fffaf0);
}

.saga-character-section--winter {
  margin-top: clamp(2.5rem, 6vw, 4.5rem);
  padding: clamp(3rem, 7vw, 5rem) 1rem;
  border-top: 1px solid #e8c974;
  border-bottom: 1px solid #e8c974;
  background:
    radial-gradient(1.5px 1.5px at 12% 18%, #fff6cfaa 98%, transparent),
    radial-gradient(1px 1px at 83% 23%, #fff 98%, transparent),
    radial-gradient(1px 1px at 70% 76%, #ffe6aa 98%, transparent),
    linear-gradient(180deg, #162e58 0%, #0e2043 100%);
  box-shadow: inset 0 15px 32px #07152a55, inset 0 -15px 32px #07152a55;
}

.saga-character-section--winter::before,
.saga-character-section--winter::after {
  position: absolute;
  z-index: -1;
  right: -12rem;
  bottom: -19rem;
  width: 34rem;
  height: 34rem;
  border: 1px solid #ffe6a51a;
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.saga-character-section--winter::after {
  right: auto;
  bottom: -22rem;
  left: -13rem;
  width: 40rem;
  height: 40rem;
}

.saga-character-shell {
  width: min(100%, 1220px);
  margin-inline: auto;
}

.saga-character-heading {
  max-width: 760px;
  margin: 0 auto clamp(1.75rem, 4vw, 2.75rem);
  text-align: center;
}

.saga-character-eyebrow {
  margin: 0 0 0.6rem;
  color: #94703a;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.saga-character-heading h2 {
  margin: 0;
  color: #342448;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.1;
}

.saga-character-heading > p:last-child {
  margin: 0.8rem 0 0;
  color: #5b5362;
  font-size: clamp(1rem, 1.8vw, 1.12rem);
  line-height: 1.6;
}

.saga-character-section--winter .saga-character-eyebrow {
  color: #ffe3a0;
}

.saga-character-section--winter .saga-character-heading h2 {
  color: #ffe3a0;
  font-family: "Baloo 2", "Nunito", sans-serif;
  text-shadow: 0 2px 15px #f4c86b44;
}

.saga-character-section--winter .saga-character-heading > p:last-child {
  color: #e4e9f6;
}

.scc-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(0.9rem, 1.7vw, 1.3rem);
}

.scc-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #d5c7aa;
  border-radius: 1.25rem;
  background: #fffaf0;
  box-shadow: 0 10px 24px #121a2e16;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.scc-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 30px #121a2e25;
}

.saga-character-section--winter .scc-card {
  border-color: #d3b86e;
  background: #fff7e7;
  box-shadow: 0 9px 24px #07152a80, inset 0 0 0 2px #e8c97430;
}

.saga-character-section--winter .scc-card:hover {
  box-shadow: 0 14px 30px #07152aad, 0 0 20px #f3d37e28;
}

.scc-card-open {
  display: flex;
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
  flex: 1;
  flex-direction: column;
  text-align: left;
}

.scc-card-open:focus-visible,
.scc-audio-button:focus-visible,
.scc-dialog-close:focus-visible {
  outline: 3px solid #d49f40;
  outline-offset: -4px;
}

.saga-character-section--winter .scc-card-open:focus-visible,
.saga-character-section--winter .scc-audio-button:focus-visible,
.scc-dialog:focus-visible,
.scc-dialog-close:focus-visible {
  outline-color: #f5d477;
}

.scc-card-media,
.scc-dialog-media {
  position: relative;
  display: grid;
  width: 100%;
  overflow: hidden;
  place-items: center;
  aspect-ratio: 1 / 1;
  background:
    radial-gradient(circle at 50% 32%, #f5d98d 0, transparent 55%),
    linear-gradient(155deg, #e5dcf2, #f9edcf);
}

.scc-card-media::after,
.scc-dialog-media::after {
  position: absolute;
  z-index: 1;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 24px 4px #f4c86b88;
  content: "";
  opacity: 0;
  pointer-events: none;
}

.scc-card-media.is-audio-playing::after,
.scc-dialog-media.is-audio-playing::after {
  opacity: 1;
  animation: scc-audio-glow 6s ease-in-out infinite alternate;
}

.scc-card-media.is-audio-paused::after,
.scc-dialog-media.is-audio-paused::after {
  opacity: 1;
}

@keyframes scc-audio-glow {
  from {
    opacity: 0.65;
  }

  to {
    opacity: 1;
  }
}

.scc-card-media img,
.scc-dialog-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.scc-card-media img {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 180ms ease;
}

.scc-card-media.is-loaded img,
.scc-dialog-media.is-loaded img {
  opacity: 1;
}

.scc-dialog-media img {
  position: absolute;
  inset: 0;
}

.scc-image-fallback {
  width: min(85%, 15rem);
  color: #5b5362;
  font-size: 0.9rem;
  text-align: center;
}

.scc-card-copy {
  display: flex;
  width: 100%;
  min-height: 10.5rem;
  padding: clamp(1rem, 1.8vw, 1.35rem);
  flex-direction: column;
  align-items: flex-start;
}

.scc-card-title {
  color: #342448;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.2rem, 1.7vw, 1.5rem);
  font-weight: 700;
  line-height: 1.2;
}

.scc-card-description {
  margin-top: 0.55rem;
  color: #5b5362;
  font-size: 0.95rem;
  line-height: 1.5;
}

.scc-card-more {
  margin-top: auto;
  padding-top: 0.8rem;
  color: #76522b;
  font-size: 0.9rem;
  font-weight: 800;
}

.saga-character-section--winter .scc-card-more {
  color: #805924;
}

.scc-audio-button {
  display: inline-flex;
  box-sizing: border-box;
  min-width: 44px;
  max-width: calc(100% - 2rem);
  min-height: 44px;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  gap: 0.5rem;
  margin: 0 1rem 1rem;
  padding: 0.55rem 1rem;
  border: 1px solid #baa06c;
  border-radius: 999px;
  color: #342448;
  background: #fffdf7;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.scc-audio-label {
  flex-shrink: 0;
}

.scc-audio-indicator {
  display: inline-flex;
  width: 76px;
  min-width: 52px;
  height: 22px;
  flex: 0 1 76px;
  align-items: center;
  justify-content: space-between;
  gap: 2px;
  visibility: hidden;
}

.scc-audio-indicator.is-audio-playing,
.scc-audio-indicator.is-audio-paused {
  visibility: visible;
}

.scc-audio-bar {
  width: 4px;
  height: 30%;
  flex-shrink: 0;
  border-radius: 999px;
  background: #b88628;
  transform: scaleY(0.22);
}

.scc-audio-bar:nth-child(2),
.scc-audio-bar:nth-child(8) {
  height: 50%;
}

.scc-audio-bar:nth-child(3),
.scc-audio-bar:nth-child(7) {
  height: 70%;
}

.scc-audio-bar:nth-child(4),
.scc-audio-bar:nth-child(6) {
  height: 88%;
}

.scc-audio-bar:nth-child(5) {
  height: 100%;
}

.scc-audio-indicator.is-audio-playing {
  animation: scc-audio-wave 1.6s ease-in-out infinite;
}

.scc-audio-indicator.is-audio-playing .scc-audio-bar {
  transform: scaleY(1);
}

.scc-audio-indicator.is-audio-reactive {
  animation: none;
  transform: none;
}

.scc-audio-indicator.is-audio-reactive .scc-audio-bar {
  transform: scaleY(var(--scc-audio-level, 0.14));
}

@keyframes scc-audio-wave {
  0%, 100% {
    transform: scaleY(0.35);
  }

  50% {
    transform: scaleY(1);
  }
}

.saga-character-section--winter .scc-audio-button {
  border-color: #c7a85b;
  color: #283555;
  background: #fff0c8;
}

.saga-character-section--winter .scc-audio-bar {
  background: #9c6a19;
}

.scc-audio-status {
  min-height: 1.4em;
  margin: -0.5rem 1rem 0.9rem;
  color: #5b5362;
  font-size: 0.85rem;
}

.scc-audio-status:empty {
  display: none;
}

.scc-dialog {
  width: min(900px, calc(100vw - 32px));
  max-width: none;
  max-height: min(90vh, 880px);
  max-height: min(90dvh, 880px);
  padding: 0;
  overflow: auto;
  border: 1px solid #d5c7aa;
  border-radius: 1.5rem;
  color: #342448;
  background: #fffaf0;
  box-shadow: 0 24px 80px #080f24aa;
}

.scc-dialog::backdrop {
  background: #07152acc;
  backdrop-filter: blur(4px);
}

.scc-dialog-panel {
  position: relative;
  display: grid;
  min-height: 420px;
  grid-template-columns: minmax(250px, 0.85fr) minmax(0, 1fr);
}

.scc-dialog-close {
  position: absolute;
  z-index: 1;
  top: 0.9rem;
  right: 0.9rem;
  min-width: 44px;
  min-height: 44px;
  padding: 0.55rem 0.9rem;
  border: 1px solid #baa06c;
  border-radius: 999px;
  color: #342448;
  background: #fffaf0;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.scc-dialog-media {
  min-height: 100%;
  aspect-ratio: auto;
  background:
    radial-gradient(circle at 50% 34%, #f5d98d 0, transparent 55%),
    linear-gradient(155deg, #e5dcf2, #f9edcf);
}

.scc-dialog-copy {
  display: flex;
  padding: clamp(2rem, 5vw, 3.5rem);
  flex-direction: column;
  justify-content: center;
}

.scc-dialog-subtitle {
  margin: 0 0 0.6rem;
  color: #94703a;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.scc-dialog-copy h2 {
  margin: 0;
  color: #342448;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4vw, 2.8rem);
  line-height: 1.1;
}

.scc-dialog-description {
  margin: 1rem 0 0;
  color: #51495a;
  font-size: clamp(1rem, 1.7vw, 1.12rem);
  line-height: 1.75;
}

.scc-dialog-copy .scc-audio-button {
  max-width: 100%;
  margin: 1.35rem 0 0;
}

.scc-dialog-copy .scc-audio-status {
  margin: 0.5rem 0 0;
}

[data-character-status]:empty {
  display: none;
}

[data-character-status] {
  margin: 1rem 0 0;
  color: inherit;
  font-size: 0.95rem;
  text-align: center;
}

.saga-character-section--classic [data-character-status] {
  color: #5b5362;
}

.saga-character-section--winter [data-character-status] {
  color: #e4e9f6;
}

@media (min-width: 701px) {
  .scc-card:nth-child(5) {
    grid-column: 2;
  }

  .scc-card:nth-child(6) {
    grid-column: 3;
  }

  .scc-card:nth-child(7) {
    grid-column: 4;
  }

  .scc-card:nth-child(5),
  .scc-card:nth-child(6),
  .scc-card:nth-child(7) {
    position: relative;
    left: -50%;
  }
}

@media (max-width: 1000px) {
  .scc-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .scc-card:nth-child(n) {
    grid-column: auto;
    left: auto;
  }

  .scc-card:nth-child(7) {
    grid-column: 2;
    left: -50%;
  }
}

@media (max-width: 700px) {
  .scc-card .scc-audio-button {
    max-width: calc(100% - 1rem);
    gap: 0.35rem;
    margin-inline: 0.5rem;
    padding-inline: 0.5rem;
  }

  .saga-character-section--winter {
    padding-inline: 0.75rem;
  }

  .scc-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }

  .scc-card-copy {
    min-height: 11rem;
    padding: 0.9rem;
  }

  .scc-card-title {
    font-size: 1.2rem;
  }

  .scc-card-description {
    font-size: 0.9rem;
  }

  .scc-card:nth-child(7) {
    grid-column: auto;
    left: auto;
  }

  .scc-dialog {
    width: calc(100vw - 24px);
    max-height: calc(100dvh - 24px);
  }

  .scc-dialog-panel {
    grid-template-columns: minmax(0, 1fr);
  }

  .scc-dialog-media {
    min-height: 0;
    max-height: 38dvh;
    aspect-ratio: 1.3 / 1;
  }

  .scc-dialog-copy {
    padding: 1.5rem;
  }

  .scc-dialog-close {
    top: 0.65rem;
    right: 0.65rem;
  }
}

@media (max-width: 360px) {
  .scc-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .scc-card-media {
    aspect-ratio: 1.2 / 1;
  }

  .scc-card-copy {
    min-height: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .scc-card,
  .scc-card-media img {
    transition: none;
  }

  .scc-audio-indicator.is-audio-playing,
  .scc-card-media.is-audio-playing::after,
  .scc-dialog-media.is-audio-playing::after {
    animation: none;
  }

  .scc-audio-indicator.is-audio-playing .scc-audio-bar {
    transform: scaleY(0.22);
  }
}
