:root {
  --st-primary: #06b6d4;
  --st-accent: #7c4dff;
  --st-dark: #0f172a;
  --st-muted: #64748b;
  --st-bg: #f1f5f9;
}

* {
  box-sizing: border-box;
}

body.stories-body {
  margin: 0;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  background: var(--st-bg);
  color: var(--st-dark);
}

.stories-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #e2e8f0;
}

.stories-topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.stories-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  color: var(--st-dark);
  text-decoration: none;
}

.stories-logo img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

.stories-nav {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.stories-nav a {
  color: #334155;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}

.stories-hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem 1rem;
}

.stories-hero h1 {
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  margin: 0 0 0.5rem;
  line-height: 1.15;
}

.stories-hero p {
  color: var(--st-muted);
  max-width: 52ch;
  margin: 0;
}

.stories-categories {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.cat-chip {
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #334155;
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.cat-chip.active,
.cat-chip:hover {
  background: linear-gradient(135deg, var(--st-primary), var(--st-accent));
  color: #fff;
  border-color: transparent;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(6, 182, 212, 0.35);
}

.stories-grid {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem 3rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
}

@media (min-width: 640px) {
  .stories-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
}

.story-card {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 9 / 16;
  background: #0f172a;
  color: #fff;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.15);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.story-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 16px 40px rgba(6, 182, 212, 0.25);
}

.story-card-link {
  position: absolute;
  inset: 0;
  text-decoration: none;
  color: inherit;
  z-index: 1;
}

.story-share-fab {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  z-index: 3;
  border: none;
  border-radius: 999px;
  padding: 0.35rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.92);
  color: #0f172a;
}

.story-card-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.55;
}

.story-card-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 30%, rgba(15, 23, 42, 0.95) 100%);
}

.story-card-body {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1rem;
  z-index: 2;
}

.story-card-cat {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.85;
}

.story-card-title {
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.25;
  margin: 0.35rem 0 0.5rem;
}

.story-progress-demo {
  display: flex;
  gap: 4px;
  margin-bottom: 0.5rem;
}

.story-progress-demo span {
  flex: 1;
  height: 3px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.35);
}

.story-progress-demo span.on {
  background: #fff;
}

.story-card-actions {
  display: flex;
  gap: 0.4rem;
}

.story-btn {
  border: none;
  border-radius: 8px;
  padding: 0.35rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.story-btn-primary {
  background: #fff;
  color: #0f172a;
}

.stories-stats {
  max-width: 1200px;
  margin: 0 auto 2rem;
  padding: 0 1rem;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

@media (min-width: 768px) {
  .stories-stats {
    grid-template-columns: repeat(4, 1fr);
  }
}

.stat-box {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 0.85rem;
  text-align: center;
}

.stat-box strong {
  display: block;
  font-size: 1.35rem;
}

.stat-box span {
  font-size: 0.8rem;
  color: var(--st-muted);
}

.stories-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--st-muted);
  padding: 2rem;
}
