/* ============================================
   DAGGERHEART THEME — SRD Daggerheart FR
   Inspired by daggerheart.com
   ============================================ */

/* --- 0. Self-hosted Google Fonts (Cinzel + Crimson Pro) --- */

/* Cinzel — latin-ext */
@font-face {
  font-family: 'Cinzel';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/cinzel-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Cinzel — latin */
@font-face {
  font-family: 'Cinzel';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/cinzel-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Cinzel 700 — latin-ext */
@font-face {
  font-family: 'Cinzel';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(../fonts/cinzel-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Cinzel 700 — latin */
@font-face {
  font-family: 'Cinzel';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(../fonts/cinzel-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Crimson Pro italic — latin-ext */
@font-face {
  font-family: 'Crimson Pro';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/crimson-pro-italic-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Crimson Pro italic — latin */
@font-face {
  font-family: 'Crimson Pro';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/crimson-pro-italic-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Crimson Pro 400 — latin-ext */
@font-face {
  font-family: 'Crimson Pro';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/crimson-pro-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Crimson Pro 400 — latin */
@font-face {
  font-family: 'Crimson Pro';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/crimson-pro-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Crimson Pro 600 — latin-ext */
@font-face {
  font-family: 'Crimson Pro';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(../fonts/crimson-pro-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Crimson Pro 600 — latin */
@font-face {
  font-family: 'Crimson Pro';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(../fonts/crimson-pro-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* --- 1. Variables --- */
:root {
  --dh-bg-dark: #1a1833;
  --dh-bg-section: #221f3a;
  --dh-bg-card: #2a2650;
  --dh-bg-card-hover: #332e5c;
  --dh-gold: #c8a84e;
  --dh-gold-light: #e8d48b;
  --dh-gold-dark: #8a7235;
  --dh-text: #e8e0d0;
  --dh-text-muted: #9e96b0;
  --dh-text-heading: #ffffff;
  --dh-border: rgba(200, 168, 78, 0.2);
  --dh-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  --dh-font-heading: 'Cinzel', serif;
  --dh-font-body: 'Crimson Pro', serif;
  --dh-font-ui: system-ui, -apple-system, sans-serif;

  /* Override global variables from _variables.css / _reset.css */
  --bg-white: transparent;
  --bg-light: transparent;
  --shadow-sm: none;
  --shadow-md: none;
  --shadow-lg: none;
  --shadow-xl: none;
  --color-gray-100: transparent;
  --color-gray-200: rgba(200, 168, 78, 0.1);
  --color-gray-300: rgba(200, 168, 78, 0.15);
  --color-gray-400: rgba(200, 168, 78, 0.2);
  --color-gray-500: #9e96b0;
  --color-gray-600: #e8e0d0;
  --color-gray-700: #e8e0d0;
  --color-gray-800: #ffffff;
  --color-gray-900: #ffffff;
  --radius-lg: 0;
  --max-width-content: 1200px;
  --color-primary: #c8a84e;
  --color-secondary: #9e96b0;
}

/* --- 2. Base --- */
body {
  background: var(--dh-bg-dark) !important;
  color: var(--dh-text) !important;
  font-family: var(--dh-font-body);
  line-height: 1.7;
  margin: 0;
}

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--dh-text);
}

h1 { color: var(--dh-text-heading); font-family: var(--dh-font-heading); }

h2, h3 {
  font-family: var(--dh-font-heading);
  color: var(--dh-text-heading);
  border-bottom: 1px solid var(--dh-border);
  padding-bottom: 0.5rem;
  margin-top: 1.5rem;
  margin-bottom: 1rem;
}

h4, h5, h6 { color: var(--dh-text-heading); }

h2 { font-size: 2rem; }
h3 { font-size: 1.4rem; }

section {
  border: none !important;
  border-radius: 0;
  padding: 0;
  text-align: left;
  background: transparent;
  color: var(--dh-text);
}

a { color: var(--dh-gold); transition: color 0.2s ease; }
a:hover { color: var(--dh-gold-light); }

p, li, td, th, span, label, dt, dd {
  color: var(--dh-text);
}

strong { color: var(--dh-text-heading); }
em { color: var(--dh-text); }

blockquote {
  border-left: 3px solid var(--dh-gold);
  background: var(--dh-bg-card);
  padding: 1rem 1.5rem;
  color: var(--dh-text);
}

code, pre {
  background: var(--dh-bg-card);
  color: var(--dh-text);
}

hr {
  border-color: var(--dh-border);
}

/* === NUCLEAR OVERRIDE: Force dark theme on ALL elements === */
/* This overrides inline styles, <style> blocks, and any page-specific CSS */

/* All block elements: dark background */
main div,
main section,
main article,
main aside,
main fieldset {
  background-color: var(--dh-bg-card) !important;
  color: var(--dh-text) !important;
}

/* Nested depth: slightly darker */
main div div,
main section div {
  background-color: var(--dh-bg-section) !important;
}

/* Reset for layout containers that should be transparent */
main,
main > section,
.tiles-grid,
.responsive-grid,
.srd-features-grid,
.dh-stats-grid,
.dh-faq,
.dh-videos-grid,
.dh-section,
.dh-section-alt {
  background-color: transparent !important;
}

/* Named sections get their proper bg back */
.dh-section-alt {
  background: var(--dh-bg-section) !important;
}

.dh-tools,
.dh-resources {
  background: var(--dh-bg-card) !important;
}

/* Table cells */
td, th {
  background-color: inherit !important;
}

tr:nth-child(even) {
  background-color: var(--dh-bg-section) !important;
}

/* All text colors */
main * {
  color: var(--dh-text);
}

main h1, main h2, main h3, main h4, main h5, main h6,
main strong, main b {
  color: var(--dh-text-heading) !important;
}

main a {
  color: var(--dh-gold) !important;
}

main a:hover {
  color: var(--dh-gold-light) !important;
}

main small {
  color: var(--dh-text-muted) !important;
}

/* Sidebar/aside in content pages */
main aside,
aside.sidebar-sticky {
  background-color: var(--dh-bg-card) !important;
  color: var(--dh-text) !important;
  border: 1px solid var(--dh-border) !important;
}

aside a {
  color: var(--dh-gold) !important;
  background: transparent !important;
}

/* Form elements */
main input, main select, main textarea {
  background: var(--dh-bg-card) !important;
  color: var(--dh-text) !important;
  border: 1px solid var(--dh-border) !important;
  border-radius: 6px;
  padding: 0.5rem;
}

main input:focus, main select:focus, main textarea:focus {
  border-color: var(--dh-gold) !important;
  outline: none;
}

/* Buttons */
main button,
main .filter-btn {
  background: var(--dh-bg-card) !important;
  color: var(--dh-text) !important;
  border: 1px solid var(--dh-border) !important;
}

main button:hover,
main .filter-btn:hover {
  background: var(--dh-gold) !important;
  color: var(--dh-bg-dark) !important;
}

/* Table rows/cells with inline styles */
main tr[style], main td[style], main th[style] {
  background-color: var(--dh-bg-card) !important;
  color: var(--dh-text) !important;
}

main tr[style]:nth-child(even) {
  background-color: var(--dh-bg-section) !important;
}

/* Content page section separators */
.main-content h3,
.main-content h4 {
  border-left: 3px solid var(--dh-gold);
  padding-left: 0.8rem;
  margin-top: 2rem;
}

.main-content > div,
.main-content > section {
  border-bottom: 1px solid var(--dh-border);
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
}

/* Override all responsive-container/grid from global */
.responsive-container {
  background: var(--dh-bg-card) !important;
  color: var(--dh-text) !important;
  border: 1px solid var(--dh-border) !important;
  border-radius: 8px;
  padding: 1.2rem 1.5rem;
  margin-bottom: 1rem;
}

.responsive-grid {
  background: transparent !important;
  color: var(--dh-text) !important;
  border: none !important;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

/* Reduce spacing between sections on content pages */
main > section {
  margin-bottom: 0.5rem;
}

main > nav {
  margin-bottom: 1rem;
}

/* --- Generic card overrides for ancestry, class pages etc. --- */
/* Flip cards on all hub pages (ascendances, communautés, etc.) */
.ancestry-card,
.community-card {
  background: var(--dh-bg-card) !important;
  color: var(--dh-text) !important;
}

.ancestry-card {
  min-height: 400px;
}
/* .community-card height managed by its own embedded CSS */

.ancestry-card .card-front,
.community-card .card-front,
.class-card .card-front {
  background: var(--dh-bg-card) !important;
  color: var(--dh-text) !important;
}

.ancestry-card .card-back,
.community-card .card-back,
.class-card .card-back {
  background: var(--dh-bg-section) !important;
  color: var(--dh-text) !important;
  padding: 1.2rem !important;
}

.ancestry-card .tile-icon,
.community-card .tile-icon {
  max-height: 200px !important;
  overflow: hidden;
  flex-shrink: 0;
}

.ancestry-card .tile-icon img,
.community-card .tile-icon img {
  width: 180px !important;
  height: 180px !important;
  max-width: 180px !important;
  max-height: 180px !important;
  object-fit: cover !important;
  border-radius: 10px !important;
  border: 2px solid var(--dh-gold-dark) !important;
}

.ancestry-card .tile-title,
.community-card .tile-title {
  font-family: var(--dh-font-heading) !important;
  color: var(--dh-gold) !important;
  font-size: 1.1rem;
  margin-top: 0.5rem;
}

.ancestry-card .tile-desc,
.community-card .tile-desc {
  color: var(--dh-text-muted) !important;
  font-size: 0.85rem;
}

/* Generic: any card-front/card-back that might exist */
.card-front {
  background: var(--dh-bg-card) !important;
  color: var(--dh-text) !important;
  overflow: hidden;
}

.card-back {
  background: var(--dh-bg-section) !important;
  color: var(--dh-text) !important;
}

/* Monster cards need overflow hidden for 3D flip + centered tooltips */
.monster-card .card-back {
  overflow: hidden;
}

/* Ancestry & community cards allow scrollable bonus content */
.ancestry-card .card-back,
.community-card .card-back {
  overflow-y: auto;
}

/* Constrain images inside flip cards */
.card-front img,
.card-back img {
  max-width: 100% !important;
  max-height: 60% !important;
  object-fit: cover;
  border-radius: 8px;
}

/* Ensure card-front and card-back fill their container */
.card-front,
.card-back {
  width: 100% !important;
  height: 100% !important;
  box-sizing: border-box;
}

/* --- Generic card/image overrides for ascendances, classes etc. --- */
img[style*="border-radius: 50%"],
img[style*="border-radius:50%"] {
  border-color: var(--dh-gold) !important;
}

/* Override inline blue borders and white backgrounds on all page-specific styles */
*[style*="border"][style*="#3498db"] {
  border-color: var(--dh-gold) !important;
}

*[style*="border"][style*="#2563eb"] {
  border-color: var(--dh-gold) !important;
}

/* Tables generiques */
table { color: var(--dh-text); }
th { background: var(--dh-bg-card) !important; color: var(--dh-text-heading) !important; }
td { border-color: var(--dh-border) !important; }
tr:hover { background: var(--dh-bg-card-hover) !important; }

/* Details/summary generiques */
details { background: var(--dh-bg-card); color: var(--dh-text); border-radius: 8px; }
summary { color: var(--dh-text-heading); }

/* --- Monster flip cards override --- */
.monster-card .card-front {
  background: var(--dh-bg-card) !important;
  color: var(--dh-text) !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 1.5rem !important;
  gap: 0.5rem;
}

.monster-card .card-back {
  background: var(--dh-bg-section) !important;
  color: var(--dh-text) !important;
  padding: 1.2rem;
}

/* Face avant : illustration carrée, centrée, bien espacée */
.monster-card .tile-icon {
  order: -1;
  margin-bottom: 1.2rem;
}

.monster-card .tile-icon img {
  width: 120px !important;
  height: 120px !important;
  min-width: 120px;
  min-height: 120px;
  max-width: 120px !important;
  max-height: 120px !important;
  border-radius: 10px !important;
  object-fit: cover !important;
  aspect-ratio: 1 / 1 !important;
  background: transparent !important;
  border: 2px solid var(--dh-border) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.monster-card .card-front .tile-title {
  color: var(--dh-text-heading) !important;
  font-family: var(--dh-font-heading);
  font-size: 1.15rem;
  margin-top: 0;
  margin-bottom: 0.6rem;
  text-align: center;
}

.monster-card .card-front .tile-desc {
  color: var(--dh-text-muted) !important;
  text-align: center;
  font-size: 0.9rem;
  margin-top: 0;
}

/* Face stats : nom doré, arme et capacités lisibles */
.monster-card .card-back .tile-title {
  color: var(--dh-gold) !important;
  font-family: var(--dh-font-heading);
  font-size: 1.3rem;
  margin-bottom: 0.8rem;
}

.monster-card .stat-item {
  background: var(--dh-bg-card) !important;
  border: 1px solid var(--dh-border) !important;
}

.monster-card .stat-label {
  color: var(--dh-text-muted) !important;
}

.monster-card .stat-value {
  color: var(--dh-gold) !important;
}

.monster-card .arme-info {
  background: var(--dh-bg-card) !important;
  color: var(--dh-text-heading) !important;
  border-left: 3px solid var(--dh-gold) !important;
  padding: 0.4rem 0.8rem;
}

.monster-card .capacites-title {
  color: var(--dh-gold-light) !important;
}

.monster-card .capacites {
  background: var(--dh-bg-card) !important;
  border: 1px solid var(--dh-border) !important;
}

.monster-card .capacite {
  color: var(--dh-text-heading) !important;
}

/* --- 3. Header Hero --- */
.dh-header {
  position: relative;
  z-index: 1005;
  min-height: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: visible;
  max-width: 100vw;
}

.dh-header-bg {
  overflow: hidden;
}

/* Force SRD menu full width inside header */
.dh-header .srd-menu,
.dh-header nav.srd-menu {
  width: 100%;
  position: relative;
  z-index: 2;
}

.dh-header .srd-menu-container {
  justify-content: center;
}

/* Also force the original nav (before JS replaces it) to be full width */
.dh-header > nav {
  width: 100%;
  position: relative;
  z-index: 2;
}

.dh-header-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.dh-header-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.dh-header-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(26, 24, 51, 0.3) 0%,
    rgba(26, 24, 51, 0.7) 60%,
    var(--dh-bg-dark) 100%
  );
}

.dh-header-title {
  position: relative;
  z-index: 1;
  font-family: var(--dh-font-heading);
  font-size: 3.5rem;
  font-weight: 700;
  color: var(--dh-text-heading);
  text-shadow: 0 3px 12px rgba(0, 0, 0, 0.6);
  margin: 0;
  padding: 2rem 1rem;
  text-align: center;
  letter-spacing: 0.05em;
}

/* --- 4. Tile Cards --- */
.tiles-grid .tile-card {
  background: var(--dh-bg-card);
  border: 1px solid var(--dh-border);
  color: var(--dh-text);
  border-radius: 12px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tiles-grid .tile-card:hover {
  background: var(--dh-bg-card-hover);
  border-color: var(--dh-gold);
  box-shadow: 0 0 20px rgba(200, 168, 78, 0.15);
  transform: translateY(-6px);
}

.tiles-grid .tile-card::before {
  background: linear-gradient(90deg, var(--dh-gold), var(--dh-gold-light));
}

.tiles-grid .tile-title {
  font-family: var(--dh-font-heading);
  color: var(--dh-text-heading);
}

.tiles-grid .tile-desc {
  color: var(--dh-text-muted);
}

.tiles-grid .tile-icon img {
  border-radius: 10px;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

/* --- 5. Sections --- */
.dh-section {
  padding: 3rem 0;
}

.dh-section-alt {
  padding: 3rem 0;
  background: var(--dh-bg-section);
  border-radius: 16px;
  margin: 2rem 0;
  padding: 3rem 2rem;
}

.dh-resources {
  padding: 1.5rem;
  border-radius: 8px;
  margin: 1rem 0;
}

.dh-resources p {
  color: var(--dh-text-muted);
}

.dh-tools {
  background: var(--dh-bg-card);
  border: 1px solid var(--dh-border);
  padding: 1.5rem;
  border-radius: 8px;
  margin: 1rem 0;
}

.dh-tools p {
  color: var(--dh-text-muted);
}

.dh-text-muted {
  color: var(--dh-text-muted);
}

/* --- 6. Feature Cards --- */
.srd-features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.srd-feature-card {
  background: var(--dh-bg-card);
  border: 1px solid var(--dh-border);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
}

.srd-feature-card h3 {
  font-family: var(--dh-font-heading);
  color: var(--dh-gold);
  border-bottom: none;
  margin-top: 0;
  font-size: 1.2rem;
}

.srd-feature-card p {
  color: var(--dh-text-muted);
  font-size: 0.95rem;
  margin: 0;
}

/* --- 6b. Vidéos --- */
.dh-videos-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  margin-top: 1.5rem;
}

.dh-video-card {
  background: var(--dh-bg-card);
  border-radius: 12px;
  border: 1px solid var(--dh-border);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.dh-video-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.dh-video-wrapper {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  overflow: hidden;
}

.dh-video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.dh-video-card h3 {
  padding: 1rem 1.2rem 0.3rem;
  font-family: var(--dh-font-heading);
  font-size: 1.1rem;
  color: var(--dh-gold) !important;
}

.dh-video-card p {
  padding: 0 1.2rem 1.2rem;
  font-size: 0.9rem;
  color: var(--dh-text-muted);
  line-height: 1.5;
}

@media (max-width: 768px) {
  .dh-videos-grid {
    grid-template-columns: 1fr;
  }
}

/* --- 7. FAQ --- */
.dh-faq {
  display: grid;
  gap: 1rem;
  margin: 1.5rem 0;
}

.dh-faq-item {
  background: var(--dh-bg-card);
  padding: 1.5rem;
  border-radius: 8px;
  border-left: 4px solid var(--dh-gold);
  cursor: pointer;
  transition: background 0.2s ease;
}

.dh-faq-item:hover {
  background: var(--dh-bg-card-hover);
}

.dh-faq-item summary {
  font-family: var(--dh-font-heading);
  font-weight: 700;
  color: var(--dh-text-heading);
  font-size: 1.05em;
  list-style: none;
}

.dh-faq-item summary::-webkit-details-marker {
  display: none;
}

.dh-faq-item summary::before {
  content: '\25B6';
  display: inline-block;
  margin-right: 0.6rem;
  font-size: 0.75em;
  color: var(--dh-gold);
  transition: transform 0.2s ease;
}

.dh-faq-item[open] summary::before {
  transform: rotate(90deg);
}

.dh-faq-item p {
  margin: 0.75rem 0 0;
  color: var(--dh-text-muted);
  line-height: 1.6;
}

.dh-faq-item a {
  color: var(--dh-gold);
}

/* --- 8. Stats Counter --- */
.dh-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1.5rem;
  max-width: 600px;
  margin: 2rem auto;
  padding-top: 2rem;
  border-top: 1px solid var(--dh-border);
}

.dh-stat-number {
  font-size: 2.5em;
  font-weight: 700;
  color: var(--dh-gold);
  font-family: var(--dh-font-heading);
}

.dh-stat-label {
  font-size: 0.9em;
  color: var(--dh-text-muted);
  margin-top: 0.25rem;
}

/* --- 9. Buttons --- */
.dh-cta {
  display: inline-block;
  background: var(--dh-gold);
  color: var(--dh-bg-dark);
  font-family: var(--dh-font-ui);
  font-weight: 600;
  font-size: 1.1rem;
  padding: 0.9rem 2.5rem;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.3s ease;
  margin-top: 1.5rem;
}

.dh-cta:hover {
  background: var(--dh-gold-light);
  color: var(--dh-bg-dark);
  box-shadow: 0 0 20px rgba(200, 168, 78, 0.3);
}

/* --- 10. Footer --- */
.dh-footer {
  background: var(--dh-bg-dark);
  border-top: 1px solid var(--dh-border);
  color: var(--dh-text);
  padding: 3rem 2rem 2rem;
  margin-top: 4rem;
}

.dh-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.dh-footer-license {
  background: rgba(255, 255, 255, 0.03);
  padding: 2rem;
  border-radius: 12px;
  margin-bottom: 2rem;
  text-align: center;
  border: 1px solid var(--dh-border);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.dh-footer-license p {
  color: var(--dh-text-muted);
  font-size: 0.9em;
  line-height: 1.5;
  margin: 0;
}

.dh-footer-logo {
  height: 80px;
  width: auto;
  filter: brightness(1.1);
}

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

.dh-footer a:hover {
  color: var(--dh-gold-light);
}

.dh-footer-bottom {
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid var(--dh-border);
}

.dh-footer-bottom p {
  font-size: 0.85em;
  color: var(--dh-text-muted);
  margin: 0.25rem 0;
}

/* --- 11. Tables (Glossaire) --- */
.gt th {
  background: var(--dh-bg-card);
  color: var(--dh-text-heading);
  border-bottom: 2px solid var(--dh-gold-dark);
}

.gt td {
  border-bottom: 1px solid var(--dh-border);
  color: var(--dh-text);
}

.gt tr:hover {
  background: var(--dh-bg-card-hover);
}

.gt .en {
  color: #e74c3c;
  font-weight: 700;
}

.gt .fr {
  color: #27ae60;
  font-weight: 700;
}

.gt .lk a {
  color: var(--dh-gold);
}

.ct {
  color: var(--dh-text-heading);
  border-bottom: 2px solid var(--dh-gold);
}

.gs {
  background: var(--dh-bg-card);
  color: var(--dh-text);
  border: 2px solid var(--dh-gold-dark);
}

.gs:focus {
  border-color: var(--dh-gold);
  box-shadow: 0 0 8px rgba(200, 168, 78, 0.3);
  outline: none;
}

.cb {
  background: var(--dh-bg-card);
  color: var(--dh-text-muted);
  border: 1px solid var(--dh-border);
}

.cb:hover {
  background: var(--dh-gold);
  color: var(--dh-bg-dark);
  border-color: var(--dh-gold);
}

.cc {
  color: var(--dh-text-muted);
}

/* --- 12. Responsive --- */
@media (max-width: 768px) {
  .dh-header { min-height: 200px; }
  .dh-header-title { font-size: 2rem; padding: 1.5rem 1rem; }
  .tiles-grid { grid-template-columns: 1fr !important; gap: 1rem; }
  .dh-section-alt { padding: 1.5rem 1rem; margin: 1rem 0; }
  .srd-features-grid { grid-template-columns: 1fr 1fr; }
  .dh-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dh-footer-license { flex-direction: column; text-align: center; }

  /* Tables: horizontal scroll */
  table, .gt {
    display: block !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    max-width: 100% !important;
  }

  /* Body no overflow */
  body { overflow-x: hidden !important; }
  main { overflow-x: hidden; max-width: 100vw; }

  /* Flip cards smaller */
  .ancestry-card {
    min-height: 350px;
  }
  .community-card {
    height: auto;
    min-height: 200px;
  }

  /* Monster cards: 1 column on mobile */
  .monsters-grid,
  .monster-grid {
    grid-template-columns: 1fr !important;
  }

  .monster-card {
    min-height: 400px !important;
    max-height: 550px !important;
  }

  .monster-card .stat-label,
  .monster-card .stat-value,
  .monster-card .tile-desc,
  .monster-card .capacite,
  .monster-card .arme-info {
    font-size: 0.85rem !important;
  }

  .monster-card .tile-title {
    font-size: 1rem !important;
  }

  .monster-card .stats-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 0.4rem !important;
  }

  .monster-card .card-back {
    padding: 0.8rem !important;
    overflow-y: auto !important;
  }

  /* Responsive containers */
  .responsive-container {
    padding: 1rem !important;
  }

  .responsive-grid {
    grid-template-columns: 1fr !important;
  }

  /* Sidebar columns: stack below content on mobile */
  .sidebar-column,
  div[style*="flex: 0 0 30%"],
  div[style*="flex:0 0 30%"] {
    flex: 1 1 100% !important;
    position: relative !important;
    top: auto !important;
    width: 100% !important;
    min-width: 100% !important;
    margin-top: 2rem;
  }

  /* Flex containers that use row layout: stack on mobile */
  div[style*="display: flex"][style*="gap"] {
    flex-direction: column !important;
  }
}

@media (max-width: 480px) {
  .dh-header { min-height: 160px; }
  .dh-header-title { font-size: 1.6rem; padding: 1rem 0.5rem; }
  h2 { font-size: 1.4rem; }
  h3 { font-size: 1.1rem; }
  main { padding: 0.75rem; }
  .srd-features-grid { grid-template-columns: 1fr; }
  .dh-stats-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
  .dh-stat-number { font-size: 1.8em; }
  .dh-cta { padding: 0.6rem 1.2rem; font-size: 0.95rem; }

  /* Flip cards single column */
  .ancestry-card {
    min-height: 300px;
  }
  .community-card {
    height: auto;
    min-height: 180px;
  }

  .ancestry-card .tile-icon img,
  .community-card .tile-icon img {
    width: 120px !important;
    height: 120px !important;
    max-width: 120px !important;
    max-height: 120px !important;
  }
}

/* --- Accessibility --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

:focus-visible {
  outline: 2px solid var(--dh-gold);
  outline-offset: 2px;
}
