/* ── CSS Variables ──────────────────────────────────────────────────────────── */
:root {
  --bg: #0d0b07;
  --bg-mid: #1a17108e;
  --bg-panel: #161410;
  --bg-card: #efe8d6;
  --bg-card-alt: #e8dfc8;
  --text-light: #e2d5b5;
  --text-muted: #9a8c6e;
  --text-dark: #231d12;
  --text-dark2: #4a3e28;
  --gold: #c8a44a;
  --gold-dark: #9e7e30;
  --gold-dim: rgba(200, 164, 74, 0.15);
  --red: #9b2525;
  --border: rgba(200, 164, 74, 0.18);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.6);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --radius: 16px;
  --font-serif: Georgia, 'Times New Roman', serif;
  --font-sans: 'Segoe UI', system-ui, Arial, sans-serif;
}

/* ── Reset ──────────────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
}

body {
  background: var(--bg);
  background-image: var(--scene-bg);
  background-repeat: no-repeat;
  background-attachment: fixed;
  background-size: cover;
  color: var(--text-light);
  font-family: var(--font-serif);
  min-height: 100vh;
  line-height: 1.6;
}

a {
  color: var(--gold);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button {
  cursor: pointer;
  font-family: var(--font-serif);
  border: none;
  outline: none;
  transition: background 0.15s, opacity 0.15s;
}

button:disabled {
  opacity: 0.45;
  cursor: default;
}

/* ── Landing page ────────────────────────────────────────────────────────────── */
#landing {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem 4rem;
}

#landing-header {
  text-align: center;
  padding: 4rem 0 3rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 3rem;
}

#landing-header h1 {
  font-size: 3rem;
  letter-spacing: 0.08em;
  color: var(--gold);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}

#landing-header .tagline {
  font-style: italic;
  color: var(--text-muted);
  font-size: 1.1rem;
}

#stories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}

.story-card {
  background: var(--bg-mid);
  /* border: 1px solid var(--border); */
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
  text-decoration: none;
  display: block;
  text-align: center;
}

.story-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  text-decoration: none;
}

.story-card-thumb {
  width: 100%;
  /* height: 180px; */
  /* object-fit: cover; */
  display: block;
  /*background: #110f0a;*/
}

.story-card-thumb-placeholder {
  width: 100%;
  height: 180px;
  background: linear-gradient(135deg, #1a1710 0%, #0d0b07 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: var(--border);
}

.story-card-body {
  padding: 1.25rem 1.5rem 1.5rem;
}

.story-card-title {
  font-size: 1.2rem;
  color: var(--gold);
  margin-bottom: 0.25rem;
}

.story-card-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 0.75rem;
}

.story-card-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  justify-content: center;
}

.difficulty-badge {
  font-size: 0.75rem;
  font-family: var(--font-sans);
  padding: 0.2rem 0.6rem;
  border-radius: 2px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.difficulty-badge.facile {
  background: #14532d;
  color: #86efac;
}

.difficulty-badge.moyen {
  background: #713f12;
  color: #fcd34d;
}

.difficulty-badge.difficile {
  background: #450a0a;
  color: #fca5a5;
}

.landing-loading {
  text-align: center;
  padding: 4rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ── Avatar circle ───────────────────────────────────────────────────────────── */
.avatar-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: bold;
  font-family: var(--font-sans);
  color: #fff;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

/* ── Notification ────────────────────────────────────────────────────────────── */
#notification-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.notification {
  background: var(--bg-mid);
  border: 1px solid var(--gold);
  color: var(--gold);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-family: var(--font-sans);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateX(20px);
  transition: opacity 0.3s, transform 0.3s;
  max-width: 280px;
}

.notification.visible {
  opacity: 1;
  transform: translateX(0);
}

/* ── Utility ─────────────────────────────────────────────────────────────────── */
.hidden {
  display: none !important;
}