.story-hero {
  position: relative;
  min-height: auto;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  padding-top: 55px;
}

@media (min-width: 768px) {
  .story-hero { min-height: 70vh; padding-top: 50px; }
}

.story-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(248, 250, 252, 0) 0%,
    rgba(248, 250, 252, 0.3) 40%,
    rgba(248, 250, 252, 0.9) 70%,
    rgba(248, 250, 252, 1) 100%
  );
  z-index: 1;
}

html.dark .story-hero::before {
  background: linear-gradient(180deg,
    rgba(15, 23, 42, 0) 0%,
    rgba(15, 23, 42, 0.3) 40%,
    rgba(15, 23, 42, 0.9) 70%,
    rgba(15, 23, 42, 1) 100%
  );
}

.story-hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center top;
  transform: scale(1.02);
}

.story-hero-content { position: relative; z-index: 2; width: 100%; }

.story-initial {
  position: absolute;
  font-size: 6rem;
  opacity: 0.08;
  z-index: 0;
  font-family: 'Crimson Pro', serif;
  font-weight: 600;
  color: #4F46E5;
  user-select: none;
}

html.dark .story-initial { opacity: 0.12; color: #818CF8; }

@media (min-width: 768px) {
  .story-initial { font-size: 12rem; opacity: 0.1; }
  html.dark .story-initial { opacity: 0.15; }
}

.story-play-btn {
  background: #4F46E5;
  color: white;
  border: none;
  border-radius: 14px;
  padding: 0.85rem 2rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 4px 14px -2px rgba(15, 23, 42, 0.1);
  position: relative;
  overflow: hidden;
  font-size: 1rem;
}

.story-play-btn:focus-visible {
  outline: 2px solid #4F46E5;
  outline-offset: 2px;
}

.story-play-btn:hover {
  background: #4338CA;
  box-shadow: 0 8px 20px -4px rgba(15, 23, 42, 0.15);
}

.story-card {
  background: white;
  border: 1px solid #E2E8F0;
  border-radius: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

html.dark .story-card {
  background: #1E293B;
  border-color: #334155;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.story-card:hover {
  box-shadow: 0 12px 28px -8px rgba(0, 0, 0, 0.08);
}

html.dark .story-card:hover {
  box-shadow: 0 12px 28px -8px rgba(0, 0, 0, 0.4);
}

.story-card h2 {
  font-family: 'Crimson Pro', serif;
  font-size: 1.25rem;
  color: #0F172A;
}

html.dark .story-card h2 { color: #F1F5F9; }

@media (min-width: 768px) { .story-card h2 { font-size: 1.5rem; } }

.story-outcome {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  background: #F8FAFC;
  border-radius: 14px;
  border: 1px solid #E2E8F0;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  font-size: 0.9rem;
  color: #334155;
}

html.dark .story-outcome {
  background: #0F172A;
  border-color: #334155;
  color: #CBD5E1;
}

.story-outcome:hover {
  background: white;
  transform: translateX(4px);
  border-color: #C7D2FE;
}

html.dark .story-outcome:hover {
  background: #1E293B;
  border-color: #4F46E5;
}

.story-outcome-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #4F46E5;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: white;
  font-size: 0.65rem;
}

.story-feature-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.9rem;
  background: #F1F5F9;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #475569;
  border: 1px solid #E2E8F0;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

html.dark .story-feature-badge {
  background: #0F172A;
  border-color: #334155;
  color: #94A3B8;
}

.story-feature-badge:hover {
  background: #E2E8F0;
  border-color: #CBD5E1;
}

html.dark .story-feature-badge:hover {
  background: #1E293B;
  border-color: #475569;
}

.story-stat {
  text-align: center;
  padding: 0.875rem 0.5rem;
  background: #F8FAFC;
  border-radius: 14px;
  border: 1px solid #E2E8F0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

html.dark .story-stat {
  background: #0F172A;
  border-color: #334155;
}

@media (min-width: 768px) { .story-stat { padding: 1.25rem; } }

.story-stat-value {
  font-family: 'Crimson Pro', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: #0F172A;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}

html.dark .story-stat-value { color: #F1F5F9; }

@media (min-width: 768px) { .story-stat-value { font-size: 1.75rem; } }

.story-stat-label {
  font-size: 0.65rem;
  color: #6366F1;
  margin-top: 0.3rem;
  font-weight: 700;
}

html.dark .story-stat-label { color: #818CF8; }

.story-share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  font-size: 1.1rem;
  border: 1px solid transparent;
}

.story-share-btn:focus-visible {
  outline: 2px solid #4F46E5;
  outline-offset: 2px;
}


.story-share-btn.twitter { background: #1DA1F2; color: white; }
.story-share-btn.facebook { background: #4267B2; color: white; }
.story-share-btn.whatsapp { background: #25D366; color: white; }
.story-share-btn.copy { background: #4F46E5; color: white; }

.difficulty-beginner { background: #DCFCE7; color: #166534; border-color: #86EFAC; }
.difficulty-intermediate { background: #FEF9C3; color: #854D0E; border-color: #FDE047; }
.difficulty-advanced { background: #FEE2E2; color: #991B1B; border-color: #FCA5A5; }

html.dark .difficulty-beginner { background: #064E3B; color: #6EE7B7; border-color: #059669; }
html.dark .difficulty-intermediate { background: #713F12; color: #FDE047; border-color: #A16207; }
html.dark .difficulty-advanced { background: #7F1D1D; color: #FCA5A5; border-color: #DC2626; }

.story-collab {
  background: #FDF2F8;
  border: 1px solid #FBCFE8;
  border-radius: 14px;
}

html.dark .story-collab {
  background: #831843;
  border-color: #9D174D;
}

.story-star-filled { color: #4F46E5; }
.story-star-empty { color: #CBD5E1; }
html.dark .story-star-empty { color: #475569; }

.story-save-tip {
  background: #EEF2FF;
  border: 1px solid #C7D2FE;
  border-radius: 14px;
}

html.dark .story-save-tip {
  background: #1E1B4B;
  border-color: #3730A3;
}

.story-save-tip svg { color: #4F46E5; }
html.dark .story-save-tip svg { color: #818CF8; }

.story-save-tip-title { color: #312E81; font-weight: 700; }
html.dark .story-save-tip-title { color: #E0E7FF; }

.story-save-tip-desc { color: #3730A3; }
html.dark .story-save-tip-desc { color: #A5B4FC; }

.story-credit-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: #F8FAFC;
  border-radius: 14px;
  border: 1px solid #E2E8F0;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

html.dark .story-credit-item {
  background: #0F172A;
  border-color: #334155;
}

.story-credit-item:hover {
  border-color: #C7D2FE;
}

html.dark .story-credit-item:hover {
  border-color: #4F46E5;
}

.story-credit-label {
  font-size: 0.7rem;
  color: #64748B;
  font-weight: 700;
}

html.dark .story-credit-label { color: #94A3B8; }

.story-credit-value {
  font-weight: 700;
  color: #0F172A;
}

html.dark .story-credit-value { color: #F1F5F9; }

.story-credit-icon { color: #64748B; }
html.dark .story-credit-icon { color: #94A3B8; }

.story-tag {
  display: inline-flex;
  padding: 0.3rem 0.75rem;
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(4px);
  color: #334155;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
  border: 1px solid #E2E8F0;
}

html.dark .story-tag {
  background: rgba(30, 41, 59, 0.8);
  color: #CBD5E1;
  border-color: #334155;
}

.story-category-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(8px);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
}

html.dark .story-category-badge {
  background: rgba(30, 41, 59, 0.8);
  color: #CBD5E1;
}

.story-path-banner {
  padding: 0.75rem 1rem;
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  border-radius: 12px;
  font-size: 0.85rem;
  color: #1E40AF;
}

html.dark .story-path-banner {
  background: #1E3A5F;
  border-color: #2563EB;
  color: #93C5FD;
}

.story-error-icon { color: #A8A29E; }
html.dark .story-error-icon { color: #64748B; }

.story-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #64748B;
  font-weight: 600;
  transition: color 0.2s ease;
  cursor: pointer;
}

.story-back-link:hover { color: #0F172A; }
html.dark .story-back-link:hover { color: #F1F5F9; }

.story-divider {
  border-color: #E2E8F0;
}

html.dark .story-divider { border-color: #334155; }

.story-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #0F172A;
  margin-bottom: 12px;
  line-height: 1.2;
}

html.dark .story-title { color: #FFFFFF; }

@media (min-width: 640px) { .story-title { font-size: 2.25rem; } }
@media (min-width: 768px) { .story-title { font-size: 3rem; } }
@media (min-width: 1024px) { .story-title { font-size: 3.75rem; } }

.story-description {
  font-size: 1.1rem;
  line-height: 1.75;
  color: #334155;
}

html.dark .story-description { color: #CBD5E1; }

.story-share-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #0F172A;
  margin-bottom: 1rem;
  text-align: center;
}

html.dark .story-share-title { color: #F1F5F9; }

.story-copy-feedback {
  text-align: center;
  font-size: 0.875rem;
  color: #16A34A;
  margin-top: 0.75rem;
  opacity: 0;
  transition: opacity 0.2s ease;
}

html.dark .story-copy-feedback { color: #4ADE80; }

.story-collab-text {
  font-weight: 700;
  color: #BE185D;
}

html.dark .story-collab-text { color: #F9A8D4; }

.story-coming-desc {
  margin-top: 0.75rem;
  color: #64748B;
  font-size: 0.875rem;
}

html.dark .story-coming-desc { color: #94A3B8; }

.story-error-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #0F172A;
  margin-bottom: 1rem;
}

html.dark .story-error-title { color: #F1F5F9; }

.story-error-desc {
  color: #64748B;
  margin-bottom: 2rem;
}

html.dark .story-error-desc { color: #94A3B8; }

.story-error-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: #1E293B;
  color: white;
  border-radius: 12px;
  font-weight: 600;
  transition: background 0.2s ease;
  cursor: pointer;
}

.story-error-link:hover { background: #334155; }

html.dark .story-error-link { background: #334155; }
html.dark .story-error-link:hover { background: #475569; }
