body.story-page {
  --story-shell-bg: linear-gradient(135deg, rgba(252, 252, 255, 0.97), rgba(238, 241, 255, 0.94));
  --story-shell-border: rgba(161, 177, 235, 0.28);
  --story-shell-shadow: 0 30px 64px rgba(39, 53, 108, 0.13);
  --story-heading: #1b2348;
  --story-copy: #495474;
  --story-soft-copy: #67739a;
  --story-panel-bg: rgba(255, 255, 255, 0.78);
  --story-panel-border: rgba(145, 161, 224, 0.22);
  --story-panel-shadow: 0 20px 42px rgba(39, 53, 108, 0.1);
  --story-card-bg: rgba(255, 255, 255, 0.88);
  --story-card-border: rgba(145, 161, 224, 0.24);
  --story-card-shadow: 0 20px 40px rgba(44, 57, 115, 0.11);
  --story-btn-bg: linear-gradient(90deg, #615eff, #6b45ff 58%, #7b39ff 100%);
  --story-btn-shadow: 0 16px 28px rgba(93, 84, 255, 0.26);
  --story-top-bg: rgba(255, 255, 255, 0.82);
  --story-footer-bg: rgba(255, 255, 255, 0.76);
}

body[data-theme="dark"].story-page {
  --story-shell-bg: linear-gradient(180deg, rgba(5, 11, 38, 0.98), rgba(4, 9, 30, 0.98));
  --story-shell-border: rgba(84, 98, 186, 0.34);
  --story-shell-shadow: 0 34px 72px rgba(0, 2, 18, 0.5);
  --story-heading: #f4f6ff;
  --story-copy: #c9d3ff;
  --story-soft-copy: #95a4dc;
  --story-panel-bg: rgba(7, 15, 45, 0.86);
  --story-panel-border: rgba(83, 99, 186, 0.34);
  --story-panel-shadow: 0 24px 46px rgba(0, 2, 16, 0.34);
  --story-card-bg: linear-gradient(180deg, rgba(8, 18, 54, 0.95), rgba(4, 13, 41, 0.98));
  --story-card-border: rgba(84, 106, 208, 0.34);
  --story-card-shadow: 0 24px 46px rgba(0, 2, 16, 0.34);
  --story-btn-bg: linear-gradient(90deg, #5e66ff, #7247ff 60%, #8f37ff 100%);
  --story-btn-shadow: 0 18px 30px rgba(97, 82, 255, 0.32);
  --story-top-bg: rgba(9, 17, 49, 0.9);
  --story-footer-bg: rgba(7, 15, 45, 0.84);
}

body.story-page.page-bg {
  background:
    radial-gradient(circle at 12% 18%, rgba(127, 139, 255, 0.16), transparent 30%),
    radial-gradient(circle at 88% 12%, rgba(194, 122, 255, 0.12), transparent 26%),
    linear-gradient(180deg, #f8f9ff 0%, #eef1ff 100%);
}

body[data-theme="dark"].story-page.page-bg {
  background:
    radial-gradient(circle at 12% 18%, rgba(88, 106, 255, 0.18), transparent 30%),
    radial-gradient(circle at 84% 10%, rgba(155, 74, 255, 0.18), transparent 26%),
    linear-gradient(180deg, #04091f 0%, #020614 100%);
}

body.story-page::before {
  background:
    radial-gradient(circle at 62% 12%, rgba(139, 151, 255, 0.14), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(225, 232, 255, 0.08)),
    repeating-linear-gradient(
      90deg,
      rgba(137, 149, 215, 0.08) 0,
      rgba(137, 149, 215, 0.08) 1px,
      transparent 1px,
      transparent 96px
    );
  animation: none;
  opacity: 0.48;
}

body[data-theme="dark"].story-page::before {
  background:
    radial-gradient(circle at 62% 12%, rgba(131, 84, 255, 0.12), transparent 30%),
    linear-gradient(180deg, rgba(3, 7, 22, 0.42), rgba(2, 5, 16, 0.12)),
    repeating-linear-gradient(
      90deg,
      rgba(39, 61, 148, 0.16) 0,
      rgba(39, 61, 148, 0.16) 1px,
      transparent 1px,
      transparent 96px
    );
  opacity: 0.84;
}

body.story-page::after {
  background:
    radial-gradient(circle at 84% 16%, rgba(255, 255, 255, 0.2), transparent 22%),
    radial-gradient(circle at 12% 74%, rgba(163, 173, 255, 0.22), transparent 28%);
  animation: none;
  opacity: 0.66;
}

body[data-theme="dark"].story-page::after {
  background:
    radial-gradient(circle at 84% 16%, rgba(130, 78, 255, 0.18), transparent 22%),
    radial-gradient(circle at 12% 74%, rgba(44, 190, 255, 0.12), transparent 28%);
  opacity: 0.72;
}

.story-page-main {
  width: min(96vw, 1600px);
  max-width: none;
  margin: 8px auto 20px;
  padding: 0;
}

.story-tab-shell {
  position: relative;
  overflow: hidden;
  padding: clamp(28px, 3vw, 42px);
  border-radius: 34px;
  border: 1px solid var(--story-shell-border);
  background: var(--story-shell-bg);
  box-shadow: var(--story-shell-shadow);
  isolation: isolate;
}

.story-tab-shell::before {
  content: "";
  position: absolute;
  inset: 8% -12% auto 34%;
  height: clamp(180px, 24vw, 320px);
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 50%, rgba(138, 148, 255, 0.18), rgba(138, 148, 255, 0) 60%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0));
  transform: rotate(-10deg);
  pointer-events: none;
  z-index: -2;
}

body[data-theme="dark"].story-page .story-tab-shell::before {
  background:
    radial-gradient(circle at 50% 50%, rgba(131, 82, 255, 0.2), rgba(131, 82, 255, 0) 60%),
    linear-gradient(90deg, rgba(141, 88, 255, 0.06), rgba(255, 255, 255, 0));
}

.story-tab-shell::after {
  content: "";
  position: absolute;
  inset: auto -10% -22% 46%;
  height: 44%;
  border-radius: 50%;
  background: linear-gradient(90deg, rgba(134, 149, 255, 0.12), rgba(134, 149, 255, 0));
  pointer-events: none;
  z-index: -2;
}

body[data-theme="dark"].story-page .story-tab-shell::after {
  background: linear-gradient(90deg, rgba(124, 78, 255, 0.16), rgba(124, 78, 255, 0));
}

.story-tab-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 760px) minmax(180px, 1fr);
  gap: 20px;
  align-items: center;
  margin-bottom: 26px;
}

.story-hero-copy {
  min-width: 0;
}

.story-section-label {
  margin: 0 0 10px;
  color: var(--story-soft-copy);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.story-hero-copy h1 {
  margin: 0;
  color: var(--story-heading);
  font-family: var(--font-ui);
  font-size: clamp(40px, 4vw, 60px);
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.story-title-accent {
  display: block;
  width: 74px;
  height: 5px;
  margin: 18px 0 16px;
  border-radius: 999px;
  background: linear-gradient(90deg, #9356ff, #4d7dff);
}

.story-hero-copy p {
  margin: 0;
  color: var(--story-copy);
  font-family: var(--font-ui);
  font-size: clamp(17px, 1.2vw, 22px);
  line-height: 1.58;
}

.story-hero-decor {
  position: relative;
  min-height: 140px;
}

.story-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(0.2px);
  animation: storyFloat 8s ease-in-out infinite;
}

.story-orb-a {
  width: 84px;
  height: 84px;
  top: 10px;
  right: 32px;
  background: radial-gradient(circle at 30% 30%, rgba(255, 220, 148, 0.96), rgba(255, 149, 74, 0.85));
  box-shadow: 0 16px 30px rgba(255, 145, 64, 0.18);
}

.story-orb-b {
  width: 54px;
  height: 54px;
  right: 154px;
  bottom: 14px;
  background: radial-gradient(circle at 30% 30%, rgba(134, 192, 255, 0.92), rgba(78, 101, 255, 0.86));
  box-shadow: 0 16px 28px rgba(88, 106, 255, 0.18);
  animation-delay: -2.4s;
}

.story-orb-c {
  width: 36px;
  height: 36px;
  right: 92px;
  top: 18px;
  background: radial-gradient(circle at 30% 30%, rgba(233, 160, 255, 0.92), rgba(139, 74, 255, 0.86));
  box-shadow: 0 14px 24px rgba(139, 74, 255, 0.18);
  animation-delay: -4.2s;
}

.story-stage {
  animation: cardIn 0.45s ease both;
}

.story-stage.hidden {
  display: none;
}

.story-genre-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(16px, 1.6vw, 24px);
}

.genre-choice {
  position: relative;
  min-height: 334px;
  overflow: hidden;
  border-radius: 28px;
  border: 1px solid rgba(138, 154, 216, 0.24);
  box-shadow: 0 20px 40px rgba(46, 59, 118, 0.12);
  isolation: isolate;
}

.genre-choice[data-genre-card="adventure"] {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(240, 246, 255, 0.92));
}

.genre-choice[data-genre-card="horror"] {
  background: linear-gradient(180deg, rgba(17, 21, 53, 0.96), rgba(8, 10, 29, 0.98));
  border-color: rgba(115, 90, 218, 0.32);
}

.genre-choice-media {
  position: absolute;
  inset: 0;
  z-index: -3;
}

.genre-choice-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.genre-choice[data-genre-card="adventure"]::before,
.genre-choice[data-genre-card="horror"]::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
}

.genre-choice[data-genre-card="adventure"]::before {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.94) 42%, rgba(255, 255, 255, 0.14) 72%, rgba(255, 255, 255, 0.02) 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.16));
}

.genre-choice[data-genre-card="horror"]::before {
  background:
    linear-gradient(90deg, rgba(14, 16, 38, 0.98) 0%, rgba(17, 19, 47, 0.95) 50%, rgba(12, 12, 32, 0.26) 76%, rgba(12, 12, 32, 0.08) 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(4, 6, 18, 0.22));
}

.genre-choice[data-genre-card="adventure"]::after,
.genre-choice[data-genre-card="horror"]::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 44%;
  pointer-events: none;
  z-index: -1;
}

.genre-choice[data-genre-card="adventure"]::after {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(206, 225, 255, 0.16));
}

.genre-choice[data-genre-card="horror"]::after {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(127, 76, 255, 0.08));
}

.genre-choice-content {
  min-height: 100%;
  max-width: min(62%, 470px);
  padding: 18px 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.genre-choice-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.genre-tag,
.story-kicker,
.story-card-tag {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.genre-tag,
.story-kicker {
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(129, 147, 226, 0.22);
  color: #546289;
}

.genre-choice[data-genre-card="horror"] .genre-tag {
  background: rgba(34, 26, 72, 0.72);
  border-color: rgba(127, 103, 228, 0.32);
  color: #d6ccff;
}

.genre-icon {
  width: 74px;
  height: 74px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(149, 163, 230, 0.24);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    0 16px 28px rgba(44, 57, 115, 0.12);
}

.genre-icon svg {
  width: 38px;
  height: 38px;
}

.genre-icon-adventure {
  background: linear-gradient(135deg, rgba(241, 247, 255, 0.98), rgba(220, 235, 255, 0.96));
  color: #2b7b66;
}

.genre-icon-horror {
  background: linear-gradient(135deg, rgba(65, 28, 96, 0.92), rgba(28, 20, 73, 0.96));
  border-color: rgba(135, 104, 247, 0.36);
  color: #ff7aa5;
}

.genre-choice-copy {
  margin-top: auto;
}

.genre-choice-copy h2 {
  margin: 0 0 12px;
  font-family: var(--font-ui);
  font-size: clamp(34px, 2.6vw, 48px);
  line-height: 1;
  letter-spacing: -0.04em;
}

.genre-choice-copy p {
  margin: 0;
  font-family: var(--font-ui);
  font-size: clamp(15px, 1.05vw, 19px);
  line-height: 1.55;
}

.genre-choice[data-genre-card="adventure"] .genre-choice-copy h2 {
  color: #1a2348;
}

.genre-choice[data-genre-card="adventure"] .genre-choice-copy p {
  color: #4d5a7b;
}

.genre-choice[data-genre-card="horror"] .genre-choice-copy h2 {
  color: #f7f7ff;
}

.genre-choice[data-genre-card="horror"] .genre-choice-copy p {
  color: #d1d4f7;
}

.story-genre-button {
  width: 100%;
  min-height: 58px;
  margin-top: auto;
  padding: 0 16px 0 12px;
  border: 0;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-ui);
  font-size: clamp(17px, 1.15vw, 22px);
  font-weight: 800;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: #ffffff;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.22s ease, filter 0.22s ease;
}

.story-genre-button:hover {
  transform: translateY(-2px);
  filter: brightness(1.04);
}

.story-genre-button:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.92);
  outline-offset: 2px;
}

.story-genre-button-adventure {
  background: linear-gradient(90deg, #27c8ff, #277eff 56%, #3145ff 100%);
  box-shadow: 0 18px 30px rgba(40, 114, 255, 0.24);
}

.story-genre-button-horror {
  background: linear-gradient(90deg, #9447de, #6337d6 58%, #4820a3 100%);
  box-shadow: 0 18px 30px rgba(102, 53, 197, 0.26);
}

.story-button-icon {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.story-button-icon svg {
  width: 22px;
  height: 22px;
}

.story-button-arrow {
  width: 22px;
  height: 22px;
  margin-left: auto;
  flex: 0 0 auto;
}

.story-stage-panel,
.story-play-shell {
  position: relative;
  overflow: hidden;
  padding: clamp(20px, 2vw, 28px);
  border-radius: 28px;
  border: 1px solid var(--story-panel-border);
  background: var(--story-panel-bg);
  box-shadow: var(--story-panel-shadow);
  backdrop-filter: blur(12px);
}

.story-stage-panel::before,
.story-play-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top right, rgba(126, 142, 255, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0));
  pointer-events: none;
}

body[data-theme="dark"].story-page .story-stage-panel::before,
body[data-theme="dark"].story-page .story-play-shell::before {
  background:
    radial-gradient(circle at top right, rgba(138, 81, 255, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0));
}

.story-stage-header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.story-stage-header h3 {
  margin: 0 0 6px;
  color: var(--story-heading);
  font-family: var(--font-ui);
  font-size: clamp(28px, 2.2vw, 38px);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.story-stage-header p {
  margin: 0;
  color: var(--story-copy);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.55;
}

.story-kicker {
  margin-bottom: 12px;
}

.story-option-grid {
  position: relative;
  z-index: 1;
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.story-card {
  display: flex;
  flex-direction: column;
  min-height: 390px;
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid var(--story-card-border);
  background: var(--story-card-bg);
  box-shadow: var(--story-card-shadow);
  animation: cardIn 0.35s ease both;
}

.story-card[data-genre="horror"] {
  border-color: rgba(109, 93, 223, 0.34);
}

.story-card-preview {
  position: relative;
  min-height: 182px;
  padding: 18px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(96, 114, 193, 0.22), rgba(28, 41, 92, 0.18));
  color: #ffffff;
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.5;
}

.story-card-preview.has-image {
  background: rgba(11, 18, 40, 0.9);
}

.story-card-preview-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 0;
}

.story-card-preview-image.is-contain {
  object-fit: contain;
  background: linear-gradient(135deg, rgba(49, 72, 128, 0.9), rgba(13, 21, 46, 0.92));
}

.story-card-preview::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(10, 16, 36, 0.54)),
    linear-gradient(135deg, rgba(112, 147, 255, 0.24), rgba(19, 32, 83, 0.18));
  z-index: 0;
}

.story-card[data-genre="horror"] .story-card-preview::before {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(6, 8, 22, 0.72)),
    linear-gradient(135deg, rgba(159, 74, 255, 0.22), rgba(18, 8, 42, 0.28));
}

.story-card-preview span {
  position: relative;
  z-index: 2;
  max-width: 90%;
  text-shadow: 0 8px 18px rgba(0, 0, 0, 0.32);
}

.story-card-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 14px;
  padding: 18px;
}

.story-card-tag {
  background: rgba(106, 119, 198, 0.12);
  border: 1px solid rgba(128, 144, 223, 0.2);
  color: #5d6796;
}

body[data-theme="dark"].story-page .story-card-tag {
  background: rgba(103, 82, 212, 0.16);
  border-color: rgba(124, 103, 235, 0.26);
  color: #d4ccff;
}

.story-card h4 {
  margin: 0;
  color: var(--story-heading);
  font-family: var(--font-ui);
  font-size: clamp(24px, 1.75vw, 30px);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.story-card p {
  margin: 0;
  color: var(--story-copy);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.6;
}

.story-card-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}

.story-card-meta {
  color: var(--story-soft-copy);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.story-play-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.story-play-layout {
  position: relative;
  z-index: 1;
  margin-top: 20px;
  display: grid;
  grid-template-columns: minmax(320px, 0.96fr) minmax(360px, 1.04fr);
  gap: 20px;
  align-items: start;
}

.story-image {
  min-height: 460px;
  width: 100%;
  padding: 26px;
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(15, 23, 42, 0.56)),
    linear-gradient(135deg, rgba(59, 130, 246, 0.3), rgba(15, 23, 42, 0.18));
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  overflow: hidden;
  position: relative;
  color: #f8fafc;
}

.story-image.story-has-photo {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(15, 23, 42, 0.24)),
    linear-gradient(135deg, rgba(15, 23, 42, 0.16), rgba(15, 23, 42, 0.58));
}

.story-image.story-theme-horror {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(2, 6, 23, 0.66)),
    linear-gradient(135deg, rgba(236, 72, 153, 0.22), rgba(15, 23, 42, 0.18));
}

.story-image::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.08), transparent 36%),
    linear-gradient(180deg, transparent 0%, rgba(2, 6, 23, 0.14) 100%);
  z-index: 1;
  pointer-events: none;
}

.story-image.story-photo-contain::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.28), rgba(15, 23, 42, 0.6)),
    var(--story-scene-image) center / cover no-repeat;
  filter: blur(16px) saturate(0.9);
  transform: scale(1.08);
  z-index: 0;
}

.story-scene-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 1;
}

.story-image.story-photo-contain .story-scene-photo {
  object-fit: contain;
  object-position: center;
}

.story-scene {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.story-scene-label {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-family: var(--font-ui);
  font-weight: 700;
  opacity: 0.92;
}

.story-scene-title {
  font-size: clamp(28px, 3vw, 40px);
  font-family: var(--font-ui);
  line-height: 1;
  letter-spacing: -0.03em;
}

.story-scene-copy {
  max-width: 560px;
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.6;
  color: rgba(248, 250, 252, 0.94);
}

.story-play-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 460px;
}

.story-box {
  min-height: 182px;
  padding: 22px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(145, 161, 224, 0.24);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.64);
  color: #1f2b52;
  font-family: var(--font-ui);
  font-size: 17px;
  line-height: 1.75;
}

body[data-theme="dark"].story-page .story-box {
  background: rgba(8, 18, 54, 0.88);
  border-color: rgba(82, 104, 206, 0.32);
  color: #eef2ff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.choice-list {
  display: grid;
  gap: 10px;
}

.story-tab-shell .btn {
  min-height: 52px;
  padding: 0 18px;
  border-radius: 16px;
  border: 1px solid rgba(143, 159, 226, 0.22);
  background: rgba(255, 255, 255, 0.74);
  color: var(--story-heading);
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 14px 26px rgba(39, 53, 108, 0.08);
  transition: transform 0.18s ease, box-shadow 0.22s ease, filter 0.22s ease, background 0.22s ease;
}

body[data-theme="dark"].story-page .story-tab-shell .btn {
  background: rgba(10, 19, 56, 0.92);
  border-color: rgba(79, 98, 188, 0.32);
  color: #eef2ff;
  box-shadow: 0 16px 28px rgba(0, 2, 16, 0.24);
}

.story-tab-shell .btn:hover {
  transform: translateY(-2px);
}

.story-tab-shell .btn.primary {
  border: 0;
  background: var(--story-btn-bg);
  color: #ffffff;
  box-shadow: var(--story-btn-shadow);
}

.story-tab-shell .btn.ghost {
  background: rgba(255, 255, 255, 0.66);
}

body[data-theme="dark"].story-page .story-tab-shell .btn.ghost {
  background: rgba(10, 19, 56, 0.78);
}

.story-tab-shell .btn:focus-visible,
.story-genre-button:focus-visible,
.story-back-to-top:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.story-card .btn,
.choice-list .btn,
#story-replay {
  width: 100%;
}

.story-card .btn,
#story-replay {
  text-transform: uppercase;
}

.story-choice-list-note {
  color: var(--story-soft-copy);
}

.story-page-footer {
  width: min(96vw, 1600px);
  margin: 0 auto 34px;
  padding: 18px 24px;
  text-align: center;
  color: var(--story-copy);
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  border-radius: 24px;
  border: 1px solid var(--story-card-border);
  background: var(--story-footer-bg);
  box-shadow: 0 14px 28px rgba(29, 39, 76, 0.1);
  backdrop-filter: blur(10px);
}

.story-back-to-top {
  position: fixed;
  right: clamp(16px, 2vw, 28px);
  bottom: 22px;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border: 1px solid var(--story-card-border);
  border-radius: 18px;
  background: var(--story-top-bg);
  color: var(--story-heading);
  box-shadow: var(--story-card-shadow);
  cursor: pointer;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  z-index: 980;
}

.story-back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.story-back-to-top:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 34px rgba(42, 57, 108, 0.18);
}

.story-back-to-top svg {
  width: 22px;
  height: 22px;
}

@keyframes storyFloat {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

@media (max-width: 1220px) {
  .story-genre-grid,
  .story-option-grid {
    grid-template-columns: 1fr;
  }

  .genre-choice {
    min-height: 320px;
  }

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

  .story-hero-decor {
    min-height: 80px;
  }
}

@media (max-width: 960px) {
  .story-page-main {
    margin-top: 10px;
  }

  .story-tab-shell {
    padding: 22px 18px 20px;
    border-radius: 28px;
  }

  .genre-choice-content {
    max-width: 72%;
  }

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

  .story-image,
  .story-play-panel {
    min-height: auto;
  }

  .story-image {
    min-height: 280px;
  }
}

@media (max-width: 720px) {
  .story-hero-copy h1 {
    font-size: clamp(34px, 10vw, 48px);
  }

  .story-hero-copy p {
    font-size: 16px;
  }

  .genre-choice {
    min-height: 360px;
  }

  .genre-choice-content {
    max-width: 100%;
    padding: 18px;
  }

  .genre-choice[data-genre-card="adventure"]::before,
  .genre-choice[data-genre-card="horror"]::before {
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.94) 54%);
  }

  .genre-choice[data-genre-card="horror"]::before {
    background:
      linear-gradient(180deg, rgba(10, 10, 30, 0.2), rgba(11, 12, 35, 0.94) 58%);
  }

  .genre-choice-top {
    align-items: flex-start;
  }

  .genre-choice-copy {
    margin-top: 84px;
  }

  .genre-choice-copy h2 {
    font-size: clamp(30px, 9vw, 40px);
  }

  .genre-icon {
    width: 62px;
    height: 62px;
    border-radius: 20px;
  }

  .genre-icon svg {
    width: 30px;
    height: 30px;
  }

  .story-stage-panel,
  .story-play-shell {
    padding: 18px;
  }

  .story-stage-header,
  .story-play-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .story-play-actions .btn,
  #story-back-to-genres {
    width: 100%;
  }

  .story-card-preview {
    min-height: 170px;
  }

  .story-scene-title {
    font-size: clamp(24px, 8vw, 34px);
  }
}

@media (max-width: 560px) {
  .story-hero-decor {
    display: none;
  }

  .genre-choice {
    min-height: 380px;
  }

  .genre-choice-content {
    gap: 14px;
  }

  .story-genre-button {
    min-height: 54px;
    font-size: 15px;
  }

  .story-button-icon {
    width: 34px;
    height: 34px;
  }

  .story-image {
    min-height: 230px;
    padding: 18px;
  }

  .story-box {
    min-height: 150px;
    padding: 18px;
    font-size: 16px;
  }

  .story-page-footer {
    font-size: 13px;
  }
}
