/* ============================================================
   assets/style.css — Starsyn
   EDM Mystic Space theme
   ============================================================ */

/* --- Variables --- */
:root {
  --bg:         #08080f;
  --bg-card:    #0f0f1a;
  --bg-card2:   #13131f;
  --text:       #f0f0f0;
  --text-muted: #6b7280;
  --text-dim:   #4b5563;
  --teal:       #00e5cc;
  --yellow:     #f5d020;
  --purple:     #7b2fff;
  --pink:       #ff2d9b;
  --border:     rgba(255,255,255,0.08);
  --radius:     8px;
  --font-ui:    'Inter', sans-serif;
  --font-read:  'Merriweather', Georgia, serif;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button, input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

/* --- Star field --- */
#starfield {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}
body > *:not(#starfield) { position: relative; z-index: 1; }

/* --- Animated gradient border keyframes --- */
@keyframes borderPulse {
  0%   { border-color: var(--teal); }
  25%  { border-color: var(--yellow); }
  50%  { border-color: var(--purple); }
  75%  { border-color: var(--pink); }
  100% { border-color: var(--teal); }
}
@keyframes borderGlow {
  0%   { box-shadow: 0 0 8px var(--teal); }
  25%  { box-shadow: 0 0 8px var(--yellow); }
  50%  { box-shadow: 0 0 8px var(--purple); }
  75%  { box-shadow: 0 0 8px var(--pink); }
  100% { box-shadow: 0 0 8px var(--teal); }
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.2; }
}

/* --- Neon heading glow --- */
.neon-heading {
  text-shadow:
    0 0 6px var(--teal),
    0 0 14px var(--teal),
    0 0 30px var(--purple),
    0 0 60px var(--purple);
  color: #fff;
}

/* --- Animated border card --- */
.glow-card {
  border: 1px solid var(--teal);
  border-radius: var(--radius);
  background: var(--bg-card);
  animation: borderPulse 6s linear infinite, borderGlow 6s linear infinite;
  padding: 1.5rem;
}

/* --- Nav --- */
.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(6px);
  background: rgba(8,8,15,0.8);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-logo {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--teal);
  text-shadow: 0 0 10px var(--teal);
  letter-spacing: 0.05em;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.nav-links a { color: var(--text-muted); font-size: 0.9rem; transition: color 0.2s; }
.nav-links a:hover { color: var(--teal); text-decoration: none; }
.nav-signup {
  color: var(--pink) !important;
  border: 1px solid var(--pink);
  padding: 0.3rem 0.8rem;
  border-radius: 4px;
  transition: background 0.2s !important;
}
.nav-signup:hover { background: rgba(255,45,155,0.15) !important; }
.nav-logout {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0;
}
.nav-logout:hover { color: var(--pink); }
.clean-nav { background: rgba(8,8,15,0.95); }

/* --- Banners --- */
.banner {
  padding: 0.8rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
}
.banner-success {
  background: var(--pink);
  color: #fff;
  font-weight: 500;
}
.banner button {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 1rem;
  padding: 0;
  margin-left: 1rem;
}

/* --- Container --- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
.container-sm {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* --- Page sections --- */
.page-hero {
  text-align: center;
  padding: 4rem 1.5rem 3rem;
}
.page-hero h1 {
  font-size: clamp(1.8rem, 5vw, 3rem);
  margin-bottom: 1rem;
}
.page-hero p {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

/* --- Novel cards grid --- */
.novel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  padding: 2rem 0;
}
.novel-card {
  border: 1px solid var(--teal);
  border-radius: var(--radius);
  background: var(--bg-card);
  overflow: hidden;
  animation: borderPulse 8s linear infinite, borderGlow 8s linear infinite;
  transition: transform 0.2s;
}
.novel-card:hover { transform: translateY(-3px); }
.novel-card-cover {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: var(--bg-card2);
}
.novel-card-cover-placeholder {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, var(--purple) 0%, var(--bg-card2) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 2rem;
}
.novel-card-body { padding: 1.2rem; }
.novel-card-body h2 { font-size: 1.2rem; margin-bottom: 0.4rem; }
.novel-card-body p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1rem; }
.btn {
  display: inline-block;
  padding: 0.5rem 1.2rem;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.2s;
  border: none;
}
.btn:hover { opacity: 0.85; text-decoration: none; }
.btn-teal    { background: var(--teal); color: #000; }
.btn-pink    { background: var(--pink); color: #fff; }
.btn-outline { background: none; border: 1px solid var(--teal); color: var(--teal); }
.btn-outline:hover { background: rgba(0,229,204,0.1); }
.btn-sm { padding: 0.3rem 0.8rem; font-size: 0.82rem; }

/* --- Chapter list --- */
.chapter-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem 0;
}
.chapter-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  padding: 1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  animation: borderPulse 10s linear infinite;
}
.chapter-item.unlocked { border-color: rgba(0,229,204,0.3); }
.chapter-item.locked   { border-color: var(--border); }
.chapter-item-title {
  font-weight: 600;
  font-size: 1rem;
}
.chapter-item.unlocked .chapter-item-title a { color: var(--text); }
.chapter-item.unlocked .chapter-item-title a:hover { color: var(--teal); }
.chapter-item.locked   .chapter-item-title { color: var(--text-dim); display: flex; align-items: center; gap: 0.5rem; }
.chapter-item-hint { font-style: italic; color: var(--text-muted); font-size: 0.85rem; }

/* Lock icon */
.lock-icon { width: 14px; height: 14px; opacity: 0.5; }

/* --- Countdown --- */
.countdown {
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  color: var(--teal);
  text-shadow: 0 0 6px var(--teal);
}

/* --- Reading page (clean mode) --- */
.clean-mode body { background: var(--bg); }
.reading-content {
  max-width: 680px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
  font-family: var(--font-read);
  font-size: 1.1rem;
  line-height: 1.9;
  color: #f0f0f0;
}
.reading-content h1 {
  font-family: var(--font-ui);
  font-size: 1.6rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #fff;
}
.reading-meta {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
}
.reading-content p { margin-bottom: 1.4em; }
.reading-content blockquote {
  border-left: 3px solid var(--teal);
  padding: 0.6rem 1.2rem;
  color: var(--text-muted);
  font-style: italic;
  margin: 1.5rem 0;
  background: rgba(0,229,204,0.04);
}
.chapter-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  margin-top: 3rem;
  font-family: var(--font-ui);
}
.chapter-nav a {
  border: 1px solid var(--border);
  padding: 0.5rem 1rem;
  border-radius: 4px;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.chapter-nav a:hover { border-color: var(--teal); color: var(--teal); text-decoration: none; }
.locked-chapter {
  max-width: 680px;
  margin: 5rem auto;
  padding: 2rem;
  text-align: center;
}
.locked-chapter h1 { font-size: 1.4rem; margin-bottom: 1rem; color: var(--text-dim); }
.locked-chapter .hint { font-style: italic; color: var(--text-muted); margin-top: 1rem; font-size: 0.9rem; }

/* --- Auth forms --- */
.auth-page {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  border: 1px solid var(--teal);
  border-radius: var(--radius);
  background: var(--bg-card);
  padding: 2.5rem;
  animation: borderPulse 6s linear infinite, borderGlow 6s linear infinite;
}
.auth-card h1 { font-size: 1.5rem; margin-bottom: 1.5rem; }
.form-group { margin-bottom: 1.2rem; }
.form-group label { display: block; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.4rem; }
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.6rem 0.8rem;
  color: var(--text);
  transition: border-color 0.2s;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--teal);
}
.form-error { color: #ff6b6b; font-size: 0.82rem; margin-top: 0.3rem; }
.form-error-field { border-color: #ff6b6b !important; }
.form-success { color: var(--teal); font-size: 0.9rem; margin-bottom: 1rem; }

/* --- Comments --- */
.comments-section {
  max-width: 680px;
  margin: 3rem auto 0;
  padding: 0 1.5rem 5rem;
  font-family: var(--font-ui);
}
.comments-section h3 { font-size: 1rem; color: var(--text-muted); margin-bottom: 1.5rem; text-transform: uppercase; letter-spacing: 0.08em; }
.comment {
  background: #0f0f1a;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
}
.comment-meta { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.comment-meta span { color: var(--teal); font-weight: 500; }
.comment-body { font-size: 0.95rem; line-height: 1.6; }
.comment-form textarea {
  width: 100%;
  min-height: 80px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.6rem;
  color: var(--text);
  resize: vertical;
  margin-bottom: 0.6rem;
}
.comment-form textarea:focus { outline: none; border-color: var(--teal); }
.comment-login-prompt { color: var(--text-muted); font-size: 0.9rem; font-style: italic; }
.comment-login-prompt a { color: var(--teal); }

/* --- Profile page --- */
.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  padding: 2rem 0;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
}
.stat-card .stat-num { font-size: 2rem; font-weight: 700; color: var(--teal); }
.stat-card .stat-label { font-size: 0.82rem; color: var(--text-muted); }
.progress-bar-wrap {
  background: var(--bg);
  border-radius: 4px;
  height: 6px;
  margin: 0.4rem 0 1rem;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: var(--teal);
  border-radius: 4px;
  transition: width 0.4s ease;
}

/* --- Lore pages --- */
.lore-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.2rem;
  padding: 1.5rem 0;
}
.lore-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  overflow: hidden;
  transition: transform 0.2s;
  animation: borderPulse 9s linear infinite;
}
.lore-card:hover { transform: translateY(-2px); }
.lore-card-image {
  width: 100%;
  height: 140px;
  object-fit: cover;
  background: var(--bg-card2);
}
.lore-card-image-placeholder {
  width: 100%;
  height: 140px;
  background: linear-gradient(135deg, var(--bg-card2) 0%, #1a0a2e 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.lore-card-body { padding: 1rem; }
.lore-card-body h3 { font-size: 1rem; margin-bottom: 0.3rem; }
.lore-card-body p  { font-size: 0.85rem; color: var(--text-muted); }
.type-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.4rem;
}
.type-character { background: rgba(0,229,204,0.15); color: var(--teal); }
.type-location  { background: rgba(245,208,32,0.15); color: var(--yellow); }
.type-faction   { background: rgba(123,47,255,0.15); color: var(--purple); }
.type-timeline  { background: rgba(255,45,155,0.15); color: var(--pink); }
.type-story     { background: rgba(255,255,255,0.1); color: #ccc; }

/* Redacted (CLASSIFIED) treatment */
.classified-tag {
  font-family: 'Courier New', monospace;
  font-size: 0.8rem;
  color: var(--pink);
  animation: blink 2s ease-in-out infinite;
}
.redacted-block {
  font-family: 'Courier New', monospace;
  color: #2a2a2a;
  background: #111118;
  padding: 1rem;
  border-radius: 4px;
  line-height: 2;
  user-select: none;
}
.blurred-img {
  filter: blur(20px);
  pointer-events: none;
  user-select: none;
}

/* Lore entry page two-column layout */
.lore-entry-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 2rem;
  padding: 2rem 0;
}
.lore-fields-table { width: 100%; border-collapse: collapse; }
.lore-fields-table td {
  padding: 0.5rem 0;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.lore-fields-table td:first-child {
  color: var(--text-muted);
  width: 40%;
  padding-right: 1rem;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.lore-banner-img {
  width: 100%;
  max-height: 300px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 2rem;
}

/* --- Admin panel --- */
.admin-layout {
  display: flex;
  min-height: 100vh;
}
.admin-sidebar {
  width: 220px;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  padding: 1.5rem 0;
  flex-shrink: 0;
}
.admin-sidebar .admin-logo {
  padding: 0 1.5rem 1.5rem;
  font-weight: 700;
  color: var(--teal);
  font-size: 1.1rem;
}
.admin-sidebar a {
  display: block;
  padding: 0.6rem 1.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  border-left: 3px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.admin-sidebar a:hover,
.admin-sidebar a.active {
  color: var(--teal);
  border-left-color: var(--teal);
  background: rgba(0,229,204,0.05);
  text-decoration: none;
}
.admin-main {
  flex: 1;
  padding: 2rem;
  overflow-y: auto;
}
.admin-main h1 { font-size: 1.4rem; margin-bottom: 1.5rem; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.admin-table th {
  text-align: left;
  padding: 0.6rem 0.8rem;
  background: var(--bg-card);
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}
.admin-table td {
  padding: 0.7rem 0.8rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.admin-table tr:hover td { background: rgba(255,255,255,0.02); }
.badge-banned { color: var(--pink); font-size: 0.75rem; font-weight: 600; }
.analytics-bar-wrap { background: var(--bg); border-radius: 4px; height: 18px; overflow: hidden; min-width: 120px; }
.analytics-bar { height: 100%; background: var(--teal); border-radius: 4px; }

/* --- About page --- */
.author-card {
  max-width: 600px;
  margin: 3rem auto;
  text-align: center;
}
.author-photo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 1.2rem;
  border: 2px solid var(--teal);
  box-shadow: 0 0 16px var(--teal);
}
.mastodon-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--purple);
  padding: 0.4rem 0.9rem;
  border-radius: 4px;
  color: var(--purple);
  font-size: 0.88rem;
  margin-top: 1rem;
}
.mastodon-badge:hover { background: rgba(123,47,255,0.1); text-decoration: none; }
.mastodon-badge svg { width: 18px; height: 18px; fill: currentColor; }

/* --- Footer --- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.82rem;
}
.site-footer a { color: var(--text-dim); }
.site-footer a:hover { color: var(--teal); }
.clean-footer { background: var(--bg); }

/* --- Banned page --- */
.banned-page {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
}
.banned-page h1 { font-size: 1.2rem; color: var(--text-dim); font-weight: 400; margin-bottom: 0.5rem; }
.banned-page p  { color: var(--text-dim); font-size: 0.9rem; }

/* --- Expired QR page --- */
.expired-page {
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 1.5rem;
}
.expired-page h1 {
  font-size: 1.5rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-bottom: 1rem;
  font-style: italic;
}
.expired-page p { color: var(--text-dim); font-size: 0.9rem; max-width: 400px; }

/* --- Responsive --- */
@media (max-width: 768px) {
  .site-nav { padding: 0.8rem 1rem; }
  .nav-links { gap: 1rem; }
  .lore-entry-layout { grid-template-columns: 1fr; }
  .profile-grid { grid-template-columns: 1fr; }
  .admin-layout { flex-direction: column; }
  .admin-sidebar { width: 100%; display: flex; overflow-x: auto; padding: 0; border-right: none; border-bottom: 1px solid var(--border); }
  .admin-sidebar a { white-space: nowrap; border-left: none; border-bottom: 3px solid transparent; }
  .admin-sidebar a.active { border-bottom-color: var(--teal); }
}
