/* ============================================================
   BASE — layout.ftlh
   ============================================================ */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg-page: #ede4d0;
  --paper: #fdfcf7;
  --paper-warm: #fff8ec;
  --paper-line: #d8e2dc;
  --navy: #2d5a87;
  --navy-deep: #1e3f5f;
  --navy-soft: #5a7a8c;
  --orange: #f4a261;
  --terracotta: #e76f51;
  --sand: #f4f0e8;
  --ink-dim: #7a8b96;
  --font-serif: 'Fraunces', Georgia, serif;
  --font-sans: 'Inter Tight', system-ui, sans-serif;
}
body { font-family: var(--font-sans); background: var(--bg-page); background-image: radial-gradient(circle at 10% 0%, rgba(244,162,97,0.08) 0%, transparent 50%), radial-gradient(circle at 90% 100%, rgba(45,90,135,0.06) 0%, transparent 50%); min-height: 100vh; padding: 24px; color: var(--navy); line-height: 1.5; }
.app { max-width: 880px; margin: 0 auto; background: var(--paper); border-radius: 18px; border: 0.5px solid var(--paper-line); overflow: hidden; box-shadow: 0 24px 60px -20px rgba(45,90,135,0.18); }
.nav { background: #fff; border-bottom: 0.5px solid var(--paper-line); padding: 16px 26px; display: flex; align-items: center; justify-content: space-between; }
.logo-wrap { display: flex; align-items: center; gap: 12px; }
.logo-circ { width: 32px; height: 32px; background: var(--navy); border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.logo-circ::after { content: ''; width: 12px; height: 12px; background: var(--orange); border-radius: 50%; }
.logo-text { font-size: 18px; font-weight: 600; color: var(--navy); text-decoration: none; }
.logo-text span { color: var(--orange); }
.lang-switcher { display: flex; gap: 6px; align-items: center; }
.lang-switcher a { text-decoration: none; opacity: 0.7; transition: opacity 0.15s; }
.lang-switcher a:hover { opacity: 1; }
.lang-switcher .fi { width: 22px; height: 16px; border-radius: 2px; }
.nav-menu { display: flex; gap: 24px; align-items: center; }
.nav-menu a { font-size: 13px; color: var(--navy-soft); text-decoration: none; white-space: nowrap; }
.nav-menu a:hover { color: var(--navy); }
.nav-menu a.on { color: var(--navy); font-weight: 600; position: relative; }
.nav-menu a.on::after { content: ''; position: absolute; bottom: -16px; left: 0; right: 0; height: 2px; background: var(--orange); }
.nav-logout { background: none; border: none; color: var(--navy-soft); cursor: pointer; font-size: 13px; font-family: var(--font-sans); padding: 0; }
.nav-logout:hover { color: var(--navy); }
.hamburger-j { display: none; flex-direction: column; gap: 5px; cursor: pointer; padding: 4px; background: none; border: none; }
.hamburger-j span { display: block; width: 22px; height: 2px; background: var(--navy); border-radius: 2px; }
.mobile-menu-j { display: none; background: #fff; border-bottom: 0.5px solid var(--paper-line); padding: 8px 26px 14px; flex-direction: column; }
.mobile-menu-j a, .mobile-menu-j button { font-size: 13px; color: var(--navy-soft); text-decoration: none; padding: 10px 0; border-bottom: 0.5px solid var(--paper-line); display: block; background: none; border-left: none; border-right: none; border-top: none; width: 100%; text-align: left; font-family: var(--font-sans); cursor: pointer; }
.mobile-menu-j a.on { color: var(--navy); font-weight: 600; }
.mobile-menu-j a:last-child, .mobile-menu-j button:last-child { border-bottom: none; }
.mobile-menu-j.open { display: flex; }
.main-content { padding: 30px 26px; }
.app-footer { padding: 18px 26px; border-top: 0.5px solid var(--paper-line); background: var(--paper-warm); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.foot-text { font-size: 11px; color: var(--navy-soft); font-style: italic; font-family: var(--font-serif); }

/* ============================================================
   HOME — filrouge/home.ftlh
   ============================================================ */
.flash-error { background: #fdecea; border: 0.5px solid var(--terracotta); border-radius: 10px; padding: 12px 16px; font-size: 13px; color: var(--terracotta); margin-bottom: 20px; }
.hero { padding: 38px 26px 30px; background: linear-gradient(180deg, var(--paper-warm) 0%, var(--paper) 100%); border-bottom: 0.5px solid var(--paper-line); text-align: center; margin: -30px -26px 30px; }
.hero-title { font-family: var(--font-serif); font-size: 28px; color: var(--navy); font-style: italic; line-height: 1.3; margin: 0 auto; font-weight: 500; }
.hero-meta { font-size: 18px; color: var(--navy); font-weight: 500; margin-top: 20px; }
.end-bar { background: var(--sand); border: 0.5px solid var(--paper-line); border-radius: 14px; padding: 12px 20px; display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 30px; }
.end-bar-text { font-size: 12px; color: var(--navy-soft); }
.end-bar-text strong { color: var(--navy); font-weight: 600; }
.end-btn-locked { background: transparent; border: 1px solid var(--paper-line); color: var(--ink-dim); padding: 6px 14px; border-radius: 18px; font-size: 11px; cursor: not-allowed; }
.end-btn-active { background: transparent; border: 1px solid var(--terracotta); color: var(--terracotta); padding: 6px 14px; border-radius: 18px; font-size: 11px; font-weight: 600; text-decoration: none; transition: all 0.15s; display: inline-block; }
.end-btn-active:hover { background: var(--terracotta); color: #fff; }
.end-btn-voted { background: var(--terracotta); color: #fff; padding: 6px 14px; border-radius: 18px; font-size: 11px; border: none; text-decoration: none; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 16px; }
.section-title { font-family: var(--font-serif); font-size: 18px; color: var(--navy); font-weight: 600; }
.section-side { font-size: 12px; color: var(--terracotta); font-weight: 500; }
.recit { background: #fff; border: 0.5px solid var(--paper-line); border-left: 4px solid var(--orange); border-radius: 12px; padding: 24px 26px; font-family: var(--font-serif); font-size: 17px; line-height: 1.75; color: var(--navy); margin-bottom: 30px; }
.recit-sentence { border-bottom: 1px dotted transparent; transition: border-color 0.2s; }
.recit-sentence:hover { border-bottom-color: var(--paper-line); }
.recit-empty { font-style: italic; color: var(--ink-dim); margin-bottom: 25px; margin-left: 25px;}
.props { display: flex; flex-direction: column; gap: 10px; margin-bottom: 30px; }
.prop { background: #fff; border: 0.5px solid var(--paper-line); border-radius: 12px; padding: 14px 16px; display: flex; align-items: center; gap: 14px; transition: all 0.15s; }
.prop:hover { border-color: var(--orange); transform: translateY(-1px); }
.prop.winning { border-color: var(--orange); background: var(--paper-warm); border-width: 1.5px; }
.prop-rank-badge { width: 30px; height: 30px; border-radius: 50%; background: var(--sand); color: var(--navy); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; flex-shrink: 0; }
.prop.winning .prop-rank-badge { background: var(--orange); }
.prop-body { flex: 1; }
.prop-text { font-family: var(--font-serif); font-size: 14.5px; color: var(--navy); line-height: 1.5; }
.props .prop-author { font-family: var(--font-sans); font-size: 11px; font-weight: 400; color: #aab4bc; margin-top: 4px; }
.prop-vote { display: flex; flex-direction: column; align-items: center; min-width: 48px; }
.prop-vote-num { font-family: var(--font-serif); font-size: 20px; color: var(--navy); font-weight: 600; line-height: 1; }
.prop.winning .prop-vote-num { color: var(--terracotta); }
.prop-vote-lbl { font-size: 9px; color: var(--ink-dim); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 3px; }
.prop-action { background: transparent; border: 1px solid var(--navy); color: var(--navy); padding: 7px 14px; border-radius: 16px; font-size: 11px; cursor: pointer; font-family: var(--font-sans); font-weight: 600; transition: all 0.15s; text-decoration: none; display: inline-block; }
.prop-action:hover { background: var(--navy); color: #fff; }
.prop-action.voted { background: var(--orange); color: var(--navy); border-color: var(--orange); }
.prop-empty { font-family: var(--font-serif); font-style: italic; color: var(--ink-dim); font-size: 14px; padding: 16px 0; text-align: center; }
.submit-zone { background: var(--paper-warm); border: 0.5px solid var(--paper-line); border-radius: 14px; padding: 22px 24px; margin-bottom: 30px; }
.submit-label { font-family: var(--font-serif); font-size: 16px; color: var(--navy); font-weight: 600; margin-bottom: 12px; }
.submit-input { width: 100%; min-height: 70px; padding: 14px; font-family: var(--font-serif); font-size: 15px; font-style: italic; background: #fff; border: 0.5px solid var(--paper-line); border-radius: 8px; color: var(--navy); resize: vertical; outline: none; line-height: 1.5; }
.submit-input:focus { border-color: var(--orange); }
.submit-row { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; flex-wrap: wrap; gap: 10px; }
.submit-hint { font-size: 11px; color: var(--ink-dim); }
.submit-btn { background: var(--terracotta); color: #fff; border: none; padding: 10px 22px; border-radius: 22px; font-size: 12px; font-weight: 600; cursor: pointer; transition: background 0.15s; }
.submit-btn:hover { background: #d65a3f; }
.ranking { display: flex; flex-direction: column; }
.rank-row { display: grid; grid-template-columns: 36px 28px 1fr auto; gap: 12px; align-items: center; padding: 10px 6px; border-radius: 8px; transition: background 0.15s; }
.rank-row:hover { background: var(--paper-warm); }
.rank-row.me { background: var(--sand); }
.rank-row.rank-first .rank-pos { color: var(--terracotta); font-size: 18px; }
.rank-pos { font-family: var(--font-serif); font-size: 16px; color: var(--navy); font-weight: 600; text-align: right; font-style: italic; }
.rank-avatar { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; color: #fff; }
.rank-name { font-size: 14px; color: var(--navy); font-weight: 500; }
.me-tag { background: var(--terracotta); color: #fff; font-size: 9px; padding: 2px 6px; border-radius: 8px; margin-left: 8px; letter-spacing: 0.08em; font-weight: 600; vertical-align: middle; }
.rank-points { font-family: var(--font-serif); font-size: 18px; color: var(--navy); font-weight: 600; text-align: right; }

/* ============================================================
   BIBLIOTHÈQUE — book/list.ftlh
   ============================================================ */
.lib-hero { padding: 40px 26px 32px; background: linear-gradient(180deg, var(--paper-warm) 0%, var(--paper) 100%); border-bottom: 0.5px solid var(--paper-line); margin: -30px -26px 0; }
.hero-eyebrow { font-size: 11px; font-weight: 500; color: var(--orange); letter-spacing: 0.2em; text-transform: uppercase; margin-bottom: 10px; }
.hero-title { font-family: var(--font-serif); font-size: 36px; font-weight: 500; color: var(--navy); line-height: 1.1; letter-spacing: -0.8px; margin-bottom: 10px; }
.hero-sub { font-size: 14px; color: var(--navy-soft); line-height: 1.6; max-width: 480px; margin-bottom: 24px; }
.hero-stats { display: flex; gap: 32px; flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; }
.stat-num { font-family: var(--font-serif); font-size: 26px; font-weight: 600; color: var(--navy); line-height: 1; }
.stat-lbl { font-size: 10.5px; color: var(--ink-dim); text-transform: uppercase; letter-spacing: 0.07em; margin-top: 5px; font-weight: 500; }
.filters-bar { padding: 24px 0 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.filters-title { font-family: var(--font-serif); font-size: 18px; color: var(--navy); font-weight: 600; }
.filters-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-tab { font-size: 12px; padding: 6px 13px; border-radius: 9999px; background: transparent; border: 0.5px solid var(--paper-line); color: var(--navy-soft); text-decoration: none; font-family: var(--font-sans); transition: all 0.15s; white-space: nowrap; }
.filter-tab:hover { border-color: var(--orange); color: var(--navy); }
.filter-tab.on { background: var(--paper-warm); color: var(--navy); border-color: var(--orange); font-weight: 600; }
.books-grid { display: flex; flex-direction: column; gap: 12px; }
.book-card { background: #fff; border: 0.5px solid var(--paper-line); border-radius: 14px; padding: 20px 22px; display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: start; transition: all 0.15s ease; }
.book-card:hover { border-color: var(--orange); transform: translateY(-1px); box-shadow: 0 6px 16px -8px rgba(244,162,97,0.25); }
.book-content { min-width: 0; }
.book-title { font-family: var(--font-serif); font-size: 20px; font-weight: 500; color: var(--navy); line-height: 1.2; margin-bottom: 8px; text-decoration: none; display: block; }
.book-title:hover { color: var(--navy-deep); }
.book-incipit { font-family: var(--font-serif); font-size: 13.5px; color: var(--navy-soft); font-style: italic; line-height: 1.55; margin-bottom: 10px; }
.book-incipit::before { content: '« '; color: var(--orange); font-style: normal; }
.book-incipit::after { content: ' »'; color: var(--orange); font-style: normal; }
.book-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.book-meta-item { font-size: 11px; color: var(--ink-dim); font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; }
.book-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; padding-top: 4px; }
.like-btn { display: flex; align-items: center; gap: 5px; background: transparent; border: 0.5px solid var(--paper-line); border-radius: 9999px; padding: 5px 10px; cursor: pointer; font-size: 12px; color: var(--ink-dim); font-family: var(--font-sans); font-weight: 500; transition: all 0.15s; }
.like-btn:hover { border-color: var(--terracotta); color: var(--terracotta); }
.like-btn.liked { border-color: var(--terracotta); color: var(--terracotta); background: rgba(231,111,81,0.06); }
.like-btn .heart { font-size: 13px; transition: transform 0.15s; }
.like-btn:hover .heart, .like-btn.liked .heart { transform: scale(1.2); }
.empty { text-align: center; padding: 48px; color: var(--ink-dim); font-family: var(--font-serif); font-style: italic; }

/* ============================================================
   DÉTAIL ROMAN — book/detail.ftlh
   ============================================================ */
.detail-back { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--navy-soft); text-decoration: none; font-family: var(--font-sans); margin-bottom: 24px; transition: color 0.15s; }
.detail-back:hover { color: var(--navy); }
.detail-hero { padding-bottom: 24px; border-bottom: 0.5px solid var(--paper-line); margin-bottom: 28px; }
.detail-badge { font-size: 11px; font-weight: 500; color: var(--orange); letter-spacing: 0.2em; text-transform: uppercase; font-family: var(--font-sans); margin-bottom: 10px; }
.detail-title { font-family: var(--font-serif); font-size: 30px; font-weight: 500; color: var(--navy); line-height: 1.2; margin-bottom: 14px; }
.detail-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.detail-meta-item { font-size: 11px; color: var(--ink-dim); font-weight: 500; text-transform: uppercase; letter-spacing: 0.07em; font-family: var(--font-sans); }
.detail-meta-sep { color: var(--paper-line); font-size: 11px; }
.story-block { background: #fff; border: 0.5px solid var(--paper-line); border-left: 4px solid var(--orange); border-radius: 12px; padding: 24px 26px; margin-bottom: 32px; }
.story-text { font-family: var(--font-serif); font-size: 17px; color: var(--navy); line-height: 1.75; }
.leaderboard { display: flex; flex-direction: column; gap: 2px; }
.lb-row { display: grid; grid-template-columns: 36px 32px 1fr auto; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 8px; }
.lb-rank { font-family: var(--font-serif); font-size: 15px; font-weight: 500; color: var(--navy); font-style: italic; text-align: right; }
.lb-rank.first { color: var(--terracotta); font-size: 17px; }
.lb-avatar { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; color: white; font-family: var(--font-sans); flex-shrink: 0; }
.lb-name { font-size: 14px; font-weight: 500; color: var(--navy); font-family: var(--font-sans); }
.lb-score { font-family: var(--font-serif); font-size: 18px; font-weight: 600; color: var(--navy); }

/* ============================================================
   ADMIN — admin/propositions.ftlh
   ============================================================ */
.admin-header { margin-bottom: 24px; }
.admin-header h1 { font-family: var(--font-serif); font-size: 22px; color: var(--navy); font-weight: 600; }
.admin-header p { font-size: 13px; color: var(--ink-dim); margin-top: 4px; }
.prop-table { width: 100%; border-collapse: collapse; }
.prop-table th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--ink-dim); font-weight: 600; padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--paper-line); }
.prop-table td { padding: 14px 12px; border-bottom: 0.5px solid var(--paper-line); vertical-align: top; }
.prop-table tr:last-child td { border-bottom: none; }
.prop-table tr:hover td { background: var(--paper-warm); }
.prop-content { font-family: var(--font-serif); font-size: 15px; color: var(--navy); line-height: 1.5; }
.prop-author { font-size: 13px; font-weight: 600; color: var(--navy); }
.prop-book { font-size: 11px; color: var(--ink-dim); margin-top: 2px; }
.prop-date { font-size: 11px; color: var(--ink-dim); white-space: nowrap; }
.prop-votes { font-family: var(--font-serif); font-size: 18px; font-weight: 600; color: var(--navy); text-align: center; }

/* ============================================================
   SETUP PSEUDO — security/setup-pseudo.ftlh
   ============================================================ */
.setup-card { max-width: 420px; margin: 60px auto; background: white; border-radius: 10px; padding: 36px; box-shadow: 0 2px 12px rgba(0,0,0,0.1); }
.setup-card h1 { font-size: 1.4em; color: #2c3e50; margin-bottom: 8px; }
.setup-card p { color: #666; font-size: 0.9em; margin-bottom: 24px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 0.85em; font-weight: 600; color: #444; margin-bottom: 6px; }
.form-group input { width: 100%; padding: 10px 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 0.95em; outline: none; transition: border-color 0.2s; }
.form-group input:focus { border-color: #2c3e50; }
.hint { font-size: 0.78em; color: #999; margin-top: 4px; }
.error { background: #fdecea; color: #c0392b; padding: 10px 14px; border-radius: 6px; font-size: 0.88em; margin-bottom: 16px; }
.btn { width: 100%; padding: 11px; background: #2c3e50; color: white; border: none; border-radius: 6px; font-size: 0.95em; cursor: pointer; transition: background 0.2s; }
.btn:hover { background: #1a252f; }

/* ============================================================
   ERREURS — error/404.ftlh, error/500.ftlh
   ============================================================ */
.error-page { text-align: center; padding: 60px 26px 48px; }
.error-code { font-family: var(--font-serif); font-size: 80px; font-weight: 600; color: var(--paper-line); line-height: 1; margin-bottom: 16px; letter-spacing: -2px; }
.error-title { font-family: var(--font-serif); font-size: 24px; font-weight: 500; color: var(--navy); margin-bottom: 12px; }
.error-message { font-size: 14px; color: var(--navy-soft); line-height: 1.6; max-width: 360px; margin: 0 auto 32px; }
.error-btn { display: inline-block; padding: 10px 22px; background: var(--navy); color: #fff; border-radius: 9999px; font-size: 13px; font-weight: 600; font-family: var(--font-sans); text-decoration: none; transition: background 0.15s; }
.error-btn:hover { background: var(--navy-deep); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 720px) {
  body { padding: 12px; }
  .nav { padding: 14px 18px; }
  .nav-menu { display: none; }
  .hamburger-j { display: flex; }
  .main-content { padding: 20px 16px; }
  .hero { margin: -20px -16px 20px; }
  .lib-hero { margin: -20px -16px 0; padding: 28px 16px 24px; }
  .hero-title { font-size: 26px; }
  .book-card { grid-template-columns: 1fr; }
  .book-right { align-items: flex-start; }
  .prop { flex-wrap: wrap; }
  .prop-body { width: 100%; }
  .detail-title { font-size: 22px; }
  .story-text { font-size: 15px; }
  .lb-row { grid-template-columns: 28px 26px 1fr auto; gap: 8px; padding: 8px; }
}
