:root {
  --night: #110d35;
  --deep: #19154b;
  --violet: #5b38a5;
  --gold: #f0bd4f;
  --gold-soft: #ffe49a;
  --cyan: #42d9ff;
  --aqua: #5ee1d4;
  --ivory: #fff9e9;
  --ink: #17132b;
  --muted: #675f79;
  --card: rgba(255, 255, 255, 0.92);
  --shadow: 0 22px 70px rgba(24, 14, 60, 0.18);
  --radius-lg: 34px;
  --radius-md: 24px;
  --max-width: 1240px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 30%, rgba(80, 218, 255, 0.12), transparent 28rem),
    radial-gradient(circle at 92% 52%, rgba(240, 189, 79, 0.15), transparent 34rem),
    #fbf7ec;
  font-family: Inter, ui-rounded, "Avenir Next", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

body.dialog-open {
  overflow: hidden;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 1000;
  padding: 10px 14px;
  color: white;
  background: var(--night);
  border-radius: 12px;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 76px;
  padding: 10px max(20px, calc((100vw - var(--max-width)) / 2));
  color: white;
  background: rgba(17, 13, 53, 0.88);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--gold);
  border: 1px solid rgba(240, 189, 79, 0.5);
  border-radius: 50%;
  box-shadow: inset 0 0 18px rgba(66, 217, 255, 0.12);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand-copy strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  letter-spacing: 0.08em;
}

.brand-copy em {
  color: var(--cyan);
  font-family: inherit;
  font-style: normal;
}

.brand-copy small {
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.66);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.top-nav {
  display: flex;
  gap: 28px;
}

.top-nav a {
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
  font-weight: 750;
  text-decoration: none;
}

.top-nav a:hover {
  color: white;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.saved-button,
.language-switch {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
}

.saved-button {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  padding: 7px 9px 7px 14px;
  color: white;
  cursor: pointer;
}

.saved-button > span:first-child {
  color: var(--gold);
}

.saved-count {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  color: var(--night);
  background: var(--gold-soft);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 900;
}

.language-switch {
  display: flex;
  gap: 2px;
  padding: 3px;
}

.language-button {
  min-width: 40px;
  min-height: 34px;
  color: rgba(255, 255, 255, 0.72);
  background: transparent;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
}

.language-button.is-active {
  color: var(--night);
  background: white;
}

.world-section {
  padding: 20px;
  background: var(--night);
}

.world-art {
  position: relative;
  isolation: isolate;
  width: min(100%, 1500px);
  min-height: clamp(620px, 79vh, 820px);
  margin: 0 auto;
  overflow: hidden;
  background-image: url("assets/souma-ra.webp");
  background-position: center;
  background-size: cover;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-lg);
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.34);
}

.world-art::after {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "";
  background: linear-gradient(180deg, transparent 55%, rgba(10, 8, 35, 0.45));
  pointer-events: none;
}

.world-shade {
  position: absolute;
  inset: 0 auto 0 0;
  z-index: -1;
  width: min(64%, 780px);
  background: linear-gradient(90deg, rgba(12, 9, 41, 0.91) 0%, rgba(12, 9, 41, 0.64) 56%, transparent 100%);
}

.world-copy {
  position: absolute;
  top: 50%;
  left: clamp(26px, 6vw, 90px);
  width: min(520px, 48%);
  color: white;
  transform: translateY(-50%);
}

.eyebrow {
  margin: 0 0 14px;
  color: #936c13;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.world-copy .eyebrow {
  color: var(--gold-soft);
}

h1,
h2,
h3,
p {
  text-wrap: pretty;
}

h1,
h2 {
  font-family: Georgia, "Times New Roman", serif;
}

h1 {
  max-width: 620px;
  margin: 0;
  font-size: clamp(44px, 5.2vw, 79px);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 0.98;
  text-shadow: 0 8px 36px rgba(0, 0, 0, 0.38);
}

.world-copy > p:not(.eyebrow) {
  max-width: 500px;
  margin: 24px 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: clamp(16px, 1.5vw, 19px);
}

.primary-button,
.card-button,
.dialog-button {
  min-height: 48px;
  padding: 12px 19px;
  color: var(--night);
  background: linear-gradient(135deg, var(--gold-soft), var(--gold));
  border: 0;
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(240, 189, 79, 0.25);
  cursor: pointer;
  font-weight: 900;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.primary-button:hover,
.card-button:hover,
.dialog-button:hover {
  box-shadow: 0 14px 34px rgba(240, 189, 79, 0.38);
  transform: translateY(-2px);
}

.map-hint {
  position: absolute;
  right: 28px;
  bottom: 24px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 13px;
  color: white;
  background: rgba(17, 13, 53, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  backdrop-filter: blur(12px);
  font-size: 12px;
  font-weight: 800;
}

.pulse-dot {
  width: 9px;
  height: 9px;
  background: var(--cyan);
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(66, 217, 255, 0.55);
  animation: pulse 2s infinite;
}

.map-marker {
  position: absolute;
  z-index: 2;
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  color: white;
  background: rgba(20, 14, 62, 0.82);
  border: 2px solid var(--gold-soft);
  border-radius: 50%;
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.14), 0 10px 30px rgba(7, 4, 28, 0.42);
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition: transform 180ms ease, background 180ms ease;
}

.map-marker:hover,
.map-marker:focus-visible {
  background: var(--violet);
  transform: translate(-50%, -50%) scale(1.1);
}

.marker-icon {
  color: var(--cyan);
  font-size: 21px;
}

.marker-label {
  position: absolute;
  top: 62px;
  left: 50%;
  width: max-content;
  max-width: 170px;
  padding: 7px 10px;
  color: white;
  background: rgba(16, 12, 47, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  backdrop-filter: blur(10px);
  font-size: 11px;
  font-weight: 900;
  pointer-events: none;
  transform: translateX(-50%);
}

.marker-orbit {
  position: absolute;
  inset: -11px;
  border: 1px solid rgba(66, 217, 255, 0.65);
  border-radius: 50%;
  animation: orbit 4.4s linear infinite;
}

.marker-orbit::after {
  position: absolute;
  top: 3px;
  left: 6px;
  width: 6px;
  height: 6px;
  content: "";
  background: var(--cyan);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--cyan);
}

.marker-ashalim { left: 57%; top: 29%; }
.marker-lina { left: 78%; top: 55%; }
.marker-theo { left: 67%; top: 70%; }
.marker-kora { left: 89%; top: 27%; }
.marker-balerion { left: 49%; top: 78%; }

.companions-section,
.stories-section {
  width: min(calc(100% - 40px), var(--max-width));
  margin: 0 auto;
  padding: 96px 0;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 36px;
  margin-bottom: 34px;
}

.section-heading h2 {
  max-width: 730px;
  margin: 0;
  color: var(--night);
  font-size: clamp(37px, 4vw, 59px);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.02;
}

.section-heading > p {
  max-width: 340px;
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 15px;
}

.character-rail {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
}

.character-card {
  position: relative;
  grid-column: span 3;
  min-height: 390px;
  padding: 0;
  overflow: hidden;
  color: white;
  background: var(--deep);
  border: 0;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  cursor: pointer;
  text-align: left;
  transition: transform 220ms ease, box-shadow 220ms ease;
}

.character-card:nth-child(5) {
  grid-column: 2 / span 3;
}

.character-card.is-antagonist {
  box-shadow: 0 22px 70px rgba(79, 21, 40, 0.24);
}

.character-card.is-antagonist .character-card-copy > span {
  color: #ffb8a5;
}

.character-card:hover {
  box-shadow: 0 28px 74px rgba(24, 14, 60, 0.28);
  transform: translateY(-7px);
}

.character-card::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(180deg, transparent 34%, rgba(10, 8, 36, 0.18) 52%, rgba(10, 8, 36, 0.96) 100%);
}

.character-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 32% center;
  transition: transform 700ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.character-card:hover img {
  transform: scale(1.045);
}

.character-card-copy {
  position: absolute;
  right: 20px;
  bottom: 18px;
  left: 20px;
  z-index: 2;
}

.character-card-copy span {
  color: var(--gold-soft);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.character-card-copy h3 {
  margin: 5px 0 1px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 27px;
  font-weight: 500;
}

.character-card-copy p {
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
}

.stories-section {
  padding-top: 36px;
}

.studio-heading {
  margin-bottom: 28px;
}

.hub-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 22px;
  padding: 7px;
  background: rgba(25, 21, 75, 0.07);
  border: 1px solid rgba(25, 21, 75, 0.08);
  border-radius: 22px;
}

.hub-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 52px;
  padding: 10px 14px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 16px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 900;
  transition: color 180ms ease, background 180ms ease, transform 180ms ease;
}

.hub-tab > span:first-child {
  color: var(--violet);
  font-size: 16px;
}

.hub-tab.is-active {
  color: white;
  background: var(--night);
  box-shadow: 0 12px 30px rgba(17, 13, 53, 0.19);
}

.hub-tab.is-active > span:first-child {
  color: var(--cyan);
}

.hub-panel {
  animation: panel-enter 300ms ease both;
}

.hub-panel[hidden] {
  display: none;
}

.featured-film {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(290px, 0.7fr);
  margin-bottom: 20px;
  overflow: hidden;
  color: white;
  background:
    radial-gradient(circle at 100% 0, rgba(66, 217, 255, 0.18), transparent 25rem),
    var(--night);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 28px;
  box-shadow: 0 22px 66px rgba(19, 13, 53, 0.2);
}

.featured-film-player {
  position: relative;
  min-width: 0;
  background: #08051f;
}

.featured-film video {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 350px;
  object-fit: cover;
  background: #08051f;
}

.featured-film-copy {
  align-self: center;
  padding: 36px;
}

.featured-film-copy .eyebrow {
  color: var(--gold-soft);
}

.featured-film-copy h3 {
  margin: 0 0 13px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(31px, 3vw, 45px);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.02;
}

.featured-film-copy > p:last-child {
  margin: 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 14px;
}

.video-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  min-height: 560px;
  overflow: hidden;
  color: white;
  background: var(--night);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 30px;
  box-shadow: 0 28px 80px rgba(19, 13, 53, 0.24);
}

.video-stage {
  min-width: 0;
  background: #08051f;
}

.video-poster {
  position: relative;
  height: 100%;
  min-height: 560px;
  overflow: hidden;
}

.video-poster::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(90deg, rgba(8, 5, 31, 0.84), rgba(8, 5, 31, 0.18) 72%), linear-gradient(0deg, rgba(8, 5, 31, 0.6), transparent 60%);
}

.video-poster img {
  width: 100%;
  height: 100%;
  min-height: 560px;
  object-fit: cover;
}

.video-poster-copy {
  position: absolute;
  bottom: 58px;
  left: 48px;
  z-index: 2;
  width: min(480px, calc(100% - 96px));
}

.video-poster-copy h3 {
  margin: 15px 0 11px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(34px, 4vw, 54px);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
}

.video-poster-copy p {
  max-width: 430px;
  margin: 0 0 24px;
  color: rgba(255, 255, 255, 0.72);
}

.live-chip {
  display: inline-flex;
  padding: 7px 10px;
  color: var(--night);
  background: var(--cyan);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.11em;
}

.video-frame {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 560px;
  border: 0;
}

.video-sidebar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 38px 24px 24px;
  background:
    radial-gradient(circle at 90% 0, rgba(66, 217, 255, 0.16), transparent 18rem),
    linear-gradient(160deg, #1d1652, #100c33);
}

.video-sidebar .eyebrow {
  color: var(--gold-soft);
}

.playlist-button {
  display: grid;
  grid-template-columns: 43px 1fr;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px;
  color: white;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  cursor: pointer;
  text-align: left;
}

.playlist-button.is-active {
  background: rgba(66, 217, 255, 0.12);
  border-color: rgba(66, 217, 255, 0.48);
  box-shadow: inset 3px 0 0 var(--cyan);
}

.playlist-code {
  display: grid;
  width: 43px;
  height: 43px;
  place-items: center;
  color: var(--night);
  background: var(--gold-soft);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 950;
}

.playlist-button strong,
.playlist-button small {
  display: block;
}

.playlist-button strong {
  margin-bottom: 3px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.12;
}

.playlist-button small {
  color: rgba(255, 255, 255, 0.58);
  font-size: 11px;
}

.channel-link {
  margin-top: auto;
  padding: 14px 16px;
  color: var(--gold-soft);
  border: 1px solid rgba(240, 189, 79, 0.28);
  border-radius: 14px;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
  text-decoration: none;
}

.channel-link:hover {
  color: white;
  background: rgba(240, 189, 79, 0.12);
}

.panel-intro,
.shop-heading,
.library-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin: 42px 0 25px;
}

.panel-intro h3,
.shop-heading h3,
.library-heading h3 {
  margin: 0;
  color: var(--night);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(30px, 3.2vw, 46px);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.02;
}

.panel-intro > p,
.shop-heading > p {
  width: min(360px, 36%);
  margin: 0 0 4px;
  color: var(--muted);
}

.games-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(330px, 0.8fr);
  gap: 20px;
}

.game-card {
  padding: 26px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(41, 30, 83, 0.1);
  border-radius: 26px;
  box-shadow: 0 18px 50px rgba(35, 24, 75, 0.1);
}

.game-card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
}

.game-card-head > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.game-card h3 {
  margin: 0;
  color: var(--night);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 26px;
  font-weight: 500;
}

.game-card > p {
  margin: 12px 0 20px;
  color: var(--muted);
  font-size: 13px;
}

.game-number {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  color: var(--night);
  background: var(--gold-soft);
  border-radius: 50%;
  font-size: 10px;
  font-weight: 950;
}

.soft-button,
.book-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 14px;
  color: var(--night);
  background: #eee9fa;
  border: 1px solid rgba(91, 56, 165, 0.11);
  border-radius: 999px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
  text-decoration: none;
}

.soft-button:hover,
.book-link:hover {
  background: var(--gold-soft);
}

.game-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 30px;
  margin-bottom: 13px;
  color: var(--muted);
  font-size: 12px;
}

.game-status strong {
  color: var(--night);
  font-size: 18px;
}

#memoryMessage {
  color: #236f5d;
  font-weight: 850;
}

.memory-board {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.memory-card {
  min-width: 0;
  aspect-ratio: 0.76;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
  perspective: 600px;
}

.memory-card-inner {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 380ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.memory-card.is-flipped .memory-card-inner {
  transform: rotateY(180deg);
}

.memory-back,
.memory-face {
  position: absolute;
  inset: 0;
  display: grid;
  overflow: hidden;
  place-items: center;
  border-radius: 13px;
  backface-visibility: hidden;
}

.memory-back {
  color: var(--cyan);
  background:
    radial-gradient(circle, rgba(66, 217, 255, 0.22), transparent 40%),
    linear-gradient(145deg, #2b216e, #110d35);
  border: 1px solid rgba(255, 255, 255, 0.13);
  font-size: 24px;
}

.memory-face {
  background: var(--night);
  border: 2px solid var(--gold);
  transform: rotateY(180deg);
}

.memory-face img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.memory-face small {
  position: absolute;
  right: 4px;
  bottom: 4px;
  left: 4px;
  padding: 3px;
  color: white;
  background: rgba(17, 13, 53, 0.76);
  border-radius: 6px;
  font-size: 8px;
  font-weight: 900;
  text-align: center;
}

.memory-card.is-matched .memory-face {
  border-color: var(--cyan);
  box-shadow: 0 0 20px rgba(66, 217, 255, 0.4);
}

.quiz-progress {
  position: relative;
  display: flex;
  justify-content: flex-end;
  height: 25px;
  margin: 8px 0 18px;
  overflow: hidden;
  color: var(--muted);
  background: #eee9f7;
  border-radius: 999px;
  font-size: 10px;
}

.quiz-progress span {
  z-index: 2;
  align-self: center;
  margin-right: 10px;
  font-weight: 900;
}

.quiz-progress i {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(90deg, var(--aqua), var(--cyan));
  border-radius: inherit;
  transition: width 280ms ease;
}

#quizGame h4 {
  margin: 0 0 15px;
  color: var(--night);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 23px;
  font-weight: 500;
  line-height: 1.15;
}

.quiz-answers {
  display: grid;
  gap: 8px;
}

.quiz-answer {
  padding: 12px 14px;
  color: var(--ink);
  background: white;
  border: 1px solid rgba(25, 21, 75, 0.12);
  border-radius: 12px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 760;
  text-align: left;
}

.quiz-answer:hover:not(:disabled) {
  border-color: var(--violet);
  transform: translateX(3px);
}

.quiz-answer.is-correct {
  color: #124b40;
  background: #d9fff1;
  border-color: #4bc6a6;
}

.quiz-answer.is-wrong {
  color: #782f36;
  background: #fff0ef;
  border-color: #e68e91;
}

.quiz-feedback {
  margin: 13px 0 !important;
  color: var(--night) !important;
  font-weight: 850;
}

.quiz-result {
  display: grid;
  min-height: 270px;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: var(--night);
  text-align: center;
}

.quiz-result > span {
  color: var(--gold);
  font-size: 42px;
}

.quiz-result strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
}

.quiz-result b {
  margin-bottom: 10px;
  color: var(--violet);
  font-size: 34px;
}

.audio-grid,
.written-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.audio-card {
  display: grid;
  grid-template-columns: 118px 1fr;
  min-height: 190px;
  overflow: hidden;
  color: white;
  background: var(--night);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 22px;
  box-shadow: 0 18px 46px rgba(22, 15, 58, 0.16);
}

.audio-card.is-playing {
  box-shadow: 0 0 0 2px var(--cyan), 0 24px 60px rgba(31, 28, 89, 0.24);
}

.audio-cover {
  position: relative;
  min-height: 190px;
}

.audio-cover::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(180deg, transparent, rgba(17, 13, 53, 0.7));
}

.audio-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.audio-cover span {
  position: absolute;
  bottom: 11px;
  left: 11px;
  z-index: 2;
  color: var(--gold-soft);
  font-size: 11px;
  font-weight: 950;
}

.audio-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 18px 16px;
}

.audio-copy > p {
  margin: 0 0 6px;
  color: var(--gold-soft);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.audio-copy h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 19px;
  font-weight: 500;
  line-height: 1.07;
}

.audio-copy .soft-button {
  align-self: flex-start;
  margin-top: auto;
}

.waveform {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 29px;
  margin: 8px 0;
}

.waveform i {
  width: 3px;
  height: 8px;
  background: var(--cyan);
  border-radius: 4px;
  opacity: 0.5;
}

.waveform i:nth-child(2),
.waveform i:nth-child(6) { height: 17px; }
.waveform i:nth-child(3),
.waveform i:nth-child(5) { height: 25px; }
.waveform i:nth-child(4) { height: 13px; }

.audio-card.is-playing .waveform i {
  opacity: 1;
  animation: wave 700ms ease-in-out infinite alternate;
}

.audio-card.is-playing .waveform i:nth-child(2n) { animation-delay: 140ms; }
.audio-card.is-playing .waveform i:nth-child(3n) { animation-delay: 280ms; }

.written-card {
  position: relative;
  min-height: 360px;
  overflow: hidden;
  color: white;
  background: var(--night);
  border-radius: 24px;
  box-shadow: 0 18px 50px rgba(22, 15, 58, 0.16);
}

.written-card::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(180deg, transparent 25%, rgba(12, 8, 40, 0.95));
}

.written-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.written-card-copy {
  position: absolute;
  right: 22px;
  bottom: 21px;
  left: 22px;
  z-index: 2;
}

.written-card-copy h3 {
  margin: 0 0 7px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 27px;
  font-weight: 500;
  line-height: 1.04;
}

.written-card-copy > span {
  display: block;
  margin-bottom: 13px;
  color: rgba(255, 255, 255, 0.63);
  font-size: 11px;
}

.written-card .story-series {
  color: var(--gold-soft);
}

.shop-heading {
  margin-top: 82px;
}

.book-shelf {
  display: grid;
  grid-template-columns: repeat(7, minmax(195px, 1fr));
  gap: 15px;
  margin-right: calc((100vw - min(100vw, var(--max-width))) / -2);
  padding: 8px 20px 28px 0;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
}

.book-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  background: white;
  border: 1px solid rgba(25, 21, 75, 0.09);
  border-radius: 20px;
  box-shadow: 0 14px 42px rgba(35, 24, 75, 0.1);
  scroll-snap-align: start;
}

.book-cover {
  position: relative;
  aspect-ratio: 0.71;
  padding: 15px 15px 0;
  background: linear-gradient(145deg, #f4edda, #ebe4f4);
}

.book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px 8px 0 0;
  box-shadow: 0 10px 28px rgba(24, 14, 60, 0.21);
}

.book-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 17px;
}

.book-copy > span {
  color: #815f10;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.book-copy h3 {
  margin: 7px 0 5px;
  color: var(--night);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 19px;
  font-weight: 500;
  line-height: 1.1;
}

.book-copy p {
  margin: 0 0 15px;
  color: var(--muted);
  font-size: 11px;
}

.book-link {
  margin-top: auto;
  text-align: center;
}

.library-heading {
  margin-top: 72px;
}

.reading-dialog-hero {
  display: grid;
  grid-template-columns: 270px 1fr;
  min-height: 330px;
  color: white;
  background: var(--night);
}

.reading-dialog-hero img {
  width: 100%;
  height: 330px;
  object-fit: cover;
}

.reading-dialog-hero > div {
  align-self: end;
  padding: 40px;
}

.reading-dialog-hero .eyebrow {
  color: var(--gold-soft);
}

.reading-dialog-hero h2 {
  margin: 0 0 10px;
  font-size: clamp(35px, 5vw, 55px);
  font-weight: 500;
  line-height: 1;
}

.reading-dialog-hero span {
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
}

.reading-dialog-body {
  max-width: 700px;
  margin: 0 auto;
  padding: 38px;
}

.reading-dialog-body p {
  margin: 0 0 1.15em;
  color: #433a53;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 19px;
  line-height: 1.72;
}

.stories-heading {
  align-items: center;
}

.filter-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: rgba(25, 21, 75, 0.07);
  border: 1px solid rgba(25, 21, 75, 0.08);
  border-radius: 999px;
}

.filter-button {
  min-height: 39px;
  padding: 7px 15px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 850;
}

.filter-button.is-active {
  color: white;
  background: var(--night);
  box-shadow: 0 7px 20px rgba(17, 13, 53, 0.2);
}

.story-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.story-card {
  display: flex;
  min-height: 390px;
  flex-direction: column;
  overflow: hidden;
  background: var(--card);
  border: 1px solid rgba(41, 30, 83, 0.09);
  border-radius: var(--radius-md);
  box-shadow: 0 14px 46px rgba(35, 24, 75, 0.09);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.story-card:hover {
  box-shadow: 0 24px 58px rgba(35, 24, 75, 0.16);
  transform: translateY(-4px);
}

.story-visual {
  position: relative;
  height: 190px;
  overflow: hidden;
}

.story-visual::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(180deg, transparent 55%, rgba(13, 10, 43, 0.42));
}

.story-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 36%;
}

.story-badges {
  position: absolute;
  right: 14px;
  bottom: 13px;
  left: 14px;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.story-badge {
  padding: 6px 9px;
  color: white;
  background: rgba(17, 13, 53, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  backdrop-filter: blur(8px);
  font-size: 10px;
  font-weight: 900;
}

.story-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 20px;
}

.story-series {
  margin: 0 0 7px;
  color: #865f08;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.story-body h3 {
  margin: 0 0 9px;
  color: var(--night);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 25px;
  font-weight: 500;
  line-height: 1.08;
}

.story-body > p:not(.story-series) {
  flex: 1;
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 14px;
}

.story-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.card-button {
  min-height: 42px;
  padding: 9px 14px;
  font-size: 12px;
}

.save-story {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--violet);
  background: #f3eefc;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  font-size: 17px;
}

.save-story.is-saved {
  color: var(--night);
  background: var(--gold-soft);
}

.parent-note {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
  padding: 19px 22px;
  color: white;
  background: var(--night);
  border-radius: 20px;
}

.parent-note-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  color: var(--cyan);
  border: 1px solid rgba(66, 217, 255, 0.34);
  border-radius: 50%;
  font-size: 22px;
}

.parent-note p {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 9px;
  margin: 0;
  font-size: 13px;
}

.parent-note span:not(.parent-note-icon) {
  color: rgba(255, 255, 255, 0.67);
}

footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 120px;
  padding: 28px max(20px, calc((100vw - var(--max-width)) / 2));
  color: rgba(255, 255, 255, 0.62);
  background: var(--night);
  font-size: 12px;
}

.footer-brand {
  color: white;
}

dialog {
  width: min(94vw, 880px);
  max-height: 90vh;
  padding: 0;
  overflow: auto;
  color: var(--ink);
  background: #fffaf0;
  border: 0;
  border-radius: 30px;
  box-shadow: 0 36px 110px rgba(7, 4, 27, 0.55);
}

dialog::backdrop {
  background: rgba(10, 7, 34, 0.72);
  backdrop-filter: blur(9px);
}

.dialog-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 4;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: white;
  background: rgba(17, 13, 53, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 50%;
  cursor: pointer;
  font-size: 24px;
}

.dialog-hero {
  position: relative;
  min-height: 350px;
  background: var(--night);
}

.dialog-hero::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(90deg, rgba(12, 9, 41, 0.18), rgba(12, 9, 41, 0.8));
}

.dialog-hero img {
  width: 100%;
  height: 350px;
  object-fit: cover;
}

.dialog-hero-copy {
  position: absolute;
  right: 50px;
  bottom: 36px;
  z-index: 2;
  width: min(380px, 48%);
  color: white;
}

.dialog-hero-copy .eyebrow {
  color: var(--gold-soft);
}

.dialog-hero-copy h2 {
  margin: 0 0 8px;
  font-size: clamp(36px, 5vw, 58px);
  font-weight: 500;
  line-height: 1;
}

.dialog-hero-copy p {
  margin: 0;
  color: rgba(255, 255, 255, 0.75);
}

.dialog-body {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 34px;
  padding: 32px;
}

.dialog-body h3 {
  margin: 0 0 8px;
  color: var(--night);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 26px;
}

.dialog-body p {
  margin: 0;
  color: var(--muted);
}

.dialog-path {
  padding: 20px;
  color: white;
  background: var(--night);
  border-radius: 20px;
}

.dialog-path small {
  display: block;
  margin-bottom: 5px;
  color: var(--gold-soft);
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.dialog-path strong {
  display: block;
  margin-bottom: 15px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 21px;
  line-height: 1.16;
}

.dialog-button {
  width: 100%;
}

.saved-dialog {
  width: min(92vw, 600px);
}

.saved-dialog-content {
  min-height: 300px;
  padding: 38px 34px 34px;
}

.saved-dialog-content h2 {
  margin: 0 0 24px;
  color: var(--night);
  font-size: 42px;
}

.saved-item {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  align-items: center;
  gap: 13px;
  padding: 11px 0;
  border-top: 1px solid rgba(25, 21, 75, 0.1);
}

.saved-item img {
  width: 72px;
  height: 58px;
  object-fit: cover;
  border-radius: 12px;
}

.saved-item strong,
.saved-item span {
  display: block;
}

.saved-item strong {
  color: var(--night);
  font-size: 14px;
}

.saved-item span {
  color: var(--muted);
  font-size: 11px;
}

.saved-remove {
  width: 34px;
  height: 34px;
  color: var(--muted);
  background: #f1edf7;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.empty-state {
  padding: 36px 20px;
  color: var(--muted);
  background: rgba(91, 56, 165, 0.06);
  border: 1px dashed rgba(91, 56, 165, 0.2);
  border-radius: 18px;
  text-align: center;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 200;
  max-width: min(360px, calc(100vw - 44px));
  padding: 13px 17px;
  color: white;
  background: var(--night);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 15px;
  box-shadow: 0 18px 50px rgba(12, 8, 40, 0.3);
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes pulse {
  70% { box-shadow: 0 0 0 10px rgba(66, 217, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(66, 217, 255, 0); }
}

@keyframes orbit {
  to { transform: rotate(360deg); }
}

@keyframes panel-enter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes wave {
  to { height: 25px; }
}

@media (max-width: 1000px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .top-nav {
    display: none;
  }

  .character-rail {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .character-card {
    grid-column: span 2;
  }

  .character-card:nth-child(5) {
    grid-column: span 2;
  }

  .character-card:nth-child(7) {
    grid-column: 3 / span 2;
  }

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

  .video-layout {
    grid-template-columns: minmax(0, 1fr) 275px;
  }

  .featured-film {
    grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
  }

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

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

  .audio-card {
    grid-template-columns: 160px 1fr;
  }

  .world-copy {
    width: 54%;
  }
}

@media (max-width: 720px) {
  .site-header {
    min-height: 68px;
  }

  .brand-copy small,
  .saved-button > span:not(.saved-count):not(:first-child) {
    display: none;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
  }

  .brand-copy strong {
    font-size: 14px;
  }

  .header-actions {
    gap: 7px;
  }

  .saved-button {
    min-height: 40px;
    padding-left: 10px;
  }

  .world-section {
    padding: 8px;
  }

  .world-art {
    min-height: 700px;
    background-position: 58% center;
    border-radius: 24px;
  }

  .world-shade {
    width: 100%;
    height: 66%;
    background: linear-gradient(180deg, rgba(12, 9, 41, 0.9) 0%, rgba(12, 9, 41, 0.47) 70%, transparent 100%);
  }

  .world-copy {
    top: 52px;
    left: 24px;
    width: calc(100% - 48px);
    transform: none;
  }

  h1 {
    font-size: clamp(42px, 12vw, 59px);
  }

  .world-copy > p:not(.eyebrow) {
    max-width: 430px;
    margin: 18px 0;
    font-size: 15px;
  }

  .map-hint {
    display: none;
  }

  .map-marker {
    width: 48px;
    height: 48px;
  }

  .marker-label {
    top: 56px;
  }

  .marker-ashalim { left: 42%; top: 55%; }
  .marker-lina { left: 79%; top: 57%; }
  .marker-theo { left: 55%; top: 80%; }
  .marker-kora { left: 82%; top: 37%; }
  .marker-balerion { left: 20%; top: 78%; }

  .companions-section,
  .stories-section {
    width: min(calc(100% - 28px), var(--max-width));
    padding: 70px 0;
  }

  .stories-section {
    padding-top: 10px;
  }

  .section-heading {
    display: block;
  }

  .section-heading > p {
    margin-top: 16px;
  }

  .character-rail {
    display: flex;
    gap: 12px;
    margin-right: -14px;
    padding-right: 14px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
  }

  .character-card {
    width: min(77vw, 280px);
    min-width: min(77vw, 280px);
    grid-column: auto;
    scroll-snap-align: start;
  }

  .character-card:nth-child(5),
  .character-card:nth-child(7) {
    grid-column: auto;
  }

  .hub-tabs {
    grid-template-columns: repeat(2, 1fr);
  }

  .hub-tab {
    min-height: 48px;
  }

  .video-layout {
    grid-template-columns: 1fr;
  }

  .featured-film {
    grid-template-columns: 1fr;
  }

  .featured-film video {
    min-height: 0;
    aspect-ratio: 16 / 9;
  }

  .featured-film-copy {
    padding: 25px;
  }

  .video-poster,
  .video-poster img,
  .video-frame {
    min-height: 480px;
  }

  .video-poster-copy {
    bottom: 30px;
    left: 24px;
    width: calc(100% - 48px);
  }

  .video-poster-copy h3 {
    font-size: 38px;
  }

  .video-sidebar {
    padding: 24px;
  }

  .channel-link {
    margin-top: 10px;
  }

  .panel-intro,
  .shop-heading,
  .library-heading {
    display: block;
  }

  .panel-intro > p,
  .shop-heading > p {
    width: auto;
    margin-top: 13px;
  }

  .game-card {
    padding: 20px;
  }

  .game-card-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .memory-board {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .audio-grid,
  .written-grid {
    grid-template-columns: 1fr;
  }

  .audio-card {
    grid-template-columns: 115px 1fr;
  }

  .book-shelf {
    grid-template-columns: repeat(7, minmax(185px, 68vw));
    margin-right: -14px;
    padding-right: 14px;
  }

  .reading-dialog-hero {
    grid-template-columns: 1fr;
  }

  .reading-dialog-hero img {
    height: 270px;
  }

  .reading-dialog-hero > div {
    padding: 26px;
  }

  .reading-dialog-body {
    padding: 26px;
  }

  .stories-heading {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
  }

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

  .story-card {
    min-height: 0;
  }

  footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .dialog-hero,
  .dialog-hero img {
    min-height: 390px;
    height: 390px;
  }

  .dialog-hero img {
    object-position: 30% center;
  }

  .dialog-hero-copy {
    right: 24px;
    bottom: 24px;
    left: 24px;
    width: auto;
  }

  .dialog-hero::after {
    background: linear-gradient(180deg, transparent 25%, rgba(12, 9, 41, 0.94));
  }

  .dialog-body {
    grid-template-columns: 1fr;
    padding: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
