:root {
  --bg: #08131d;
  --bg-elevated: rgba(10, 22, 35, 0.88);
  --bg-soft: rgba(255, 248, 232, 0.08);
  --border: rgba(255, 231, 183, 0.16);
  --text: #f8f0dd;
  --muted: #b0b8c1;
  --accent: #d9a441;
  --accent-strong: #f0bf62;
  --danger: #f08f7a;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(circle at top left, rgba(240, 191, 98, 0.14), transparent 28%),
    radial-gradient(circle at bottom right, rgba(125, 173, 255, 0.12), transparent 26%),
    linear-gradient(180deg, #071018 0%, #08131d 52%, #091720 100%);
  color: var(--text);
  font-family: "Manrope", sans-serif;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

code {
  background: rgba(255, 248, 232, 0.08);
  border: 1px solid rgba(255, 248, 232, 0.08);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
}

.background-glow {
  position: fixed;
  z-index: 0;
  width: 30rem;
  height: 30rem;
  border-radius: 999px;
  filter: blur(40px);
  opacity: 0.3;
  pointer-events: none;
}

.background-glow-left {
  top: -6rem;
  left: -10rem;
  background: rgba(240, 191, 98, 0.34);
}

.background-glow-right {
  right: -8rem;
  bottom: -8rem;
  background: rgba(112, 156, 236, 0.3);
}

#app {
  position: relative;
  z-index: 1;
}

.shell {
  width: min(1200px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

.hero-panel,
.panel,
.reader-hero {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.hero-panel {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
  padding: 2rem;
  margin-bottom: 1.5rem;
}

.eyebrow {
  margin: 0 0 0.6rem;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Cinzel", serif;
  line-height: 1.1;
}

h1 {
  font-size: clamp(2.2rem, 4vw, 4rem);
}

h2 {
  font-size: clamp(1.4rem, 2vw, 2rem);
}

h3 {
  font-size: 1.15rem;
}

.hero-copy,
.story-tagline,
.reader-excerpt,
.empty-state,
label,
.panel p {
  color: var(--muted);
}

.hero-copy {
  max-width: 62ch;
  font-size: 1.03rem;
  line-height: 1.7;
}

.hero-stats,
.story-grid,
.chapter-editor-list,
.reader-chapters {
  display: grid;
  gap: 1rem;
}

.hero-stats {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

.stat-card,
.story-card,
.chapter-card,
.reader-chapter {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 1rem;
}

.stat-card strong {
  display: block;
  margin-top: 0.45rem;
  font-size: 1.9rem;
  color: var(--text);
}

.stat-label {
  color: var(--muted);
  font-size: 0.85rem;
}

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

.panel {
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.panel-section {
  min-width: 0;
}

.panel-heading,
.story-card-top,
.story-card-actions,
.reader-nav,
.reader-meta,
.reader-chapter-top,
.chapter-card-top,
.editor-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.panel-heading {
  margin-bottom: 1rem;
}

.stack-form {
  display: grid;
  gap: 1rem;
}

label {
  display: grid;
  gap: 0.5rem;
  font-size: 0.95rem;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid rgba(255, 248, 232, 0.12);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  background: rgba(6, 10, 14, 0.4);
  color: var(--text);
}

textarea {
  resize: vertical;
}

.primary-button,
.ghost-button,
.story-card-actions button {
  border-radius: 999px;
  padding: 0.8rem 1.1rem;
  border: 0;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.primary-button {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #1d1307;
  font-weight: 800;
}

.ghost-button,
.story-card-actions button {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.primary-button:hover,
.ghost-button:hover,
.story-card-actions button:hover {
  transform: translateY(-1px);
}

.story-card h3,
.reader-chapter h2 {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

.story-slug,
.chapter-count,
.reader-meta,
.chapter-index {
  color: var(--accent-strong);
  font-size: 0.86rem;
}

.status-pill {
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-published {
  background: rgba(136, 216, 177, 0.12);
  color: #97f2bf;
}

.status-draft {
  background: rgba(242, 191, 125, 0.12);
  color: #f3c27c;
}

.compact-form {
  margin-top: 1.25rem;
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0;
}

.danger-button,
.danger-text {
  color: var(--danger);
}

.reader-nav {
  margin-bottom: 1rem;
}

.reader-hero {
  padding: 2rem;
  margin-bottom: 1rem;
}

.reader-summary {
  font-size: 1rem;
  line-height: 1.7;
}

.reader-chapter {
  padding: 1.5rem;
}

.reader-body {
  display: grid;
  gap: 1rem;
  color: var(--text);
  line-height: 1.9;
}

.hidden {
  display: none;
}

@media (max-width: 900px) {
  .hero-panel,
  .grid-two {
    grid-template-columns: 1fr;
  }

  .shell {
    width: min(100% - 1rem, 1200px);
    padding-top: 1rem;
  }
}

@media (max-width: 640px) {
  .hero-panel,
  .panel,
  .reader-hero,
  .reader-chapter {
    padding: 1rem;
    border-radius: 22px;
  }

  .panel-heading,
  .story-card-top,
  .story-card-actions,
  .reader-nav,
  .reader-meta,
  .reader-chapter-top,
  .chapter-card-top,
  .editor-actions {
    align-items: flex-start;
    flex-direction: column;
  }
}
