/* Dice silo shared CSS — d4, d6, d8, d10, d12, d20, d100
 * Extracted from inline <style> blocks (identical across all 7 dice pages)
 * To edit: modify this file, do not re-inline. */

:root {
    --bg: #0d0b10;
    --bg2: #13101a;
    --surface: #1c1727;
    --border: #2e2540;
    --gold: #c9a84c;
    --gold2: #e8c96a;
    --crimson: #8b1a1a;
    --crimson2: #c0392b;
    --text: #e8e0d0;
    --text-muted: #8a7f72;
  }
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  html { scroll-behavior: smooth; }
  body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Crimson Pro', Georgia, serif;
    font-size: 16px;
    min-height: 100vh;
    -webkit-text-size-adjust: 100%;
    overflow-x: hidden;
  }
  body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
      radial-gradient(ellipse 80% 60% at 20% 20%, rgba(139,26,26,0.07) 0%, transparent 60%),
      radial-gradient(ellipse 60% 80% at 80% 80%, rgba(201,168,76,0.06) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
  }

  /* NAV */
  /* ═══ NAV ═══ */
  .site-nav {
    position: relative; z-index: 20;
    background: rgba(13,11,16,0.97);
    border-bottom: 1px solid var(--border);
  }
  body.light .site-nav { background: rgba(245,240,232,0.97); }

  /* LIGNE 1 : nom + toggle — toujours visible */
  .nav-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    height: 44px;
    border-bottom: 1px solid var(--border);
  }
  .nav-home-label {
    font-family: 'Cinzel Decorative', serif;
    font-size: 0.75rem;
    color: var(--gold);
    letter-spacing: 0.06em;
    white-space: nowrap;
    text-decoration: none;
  }
  .nav-home-label:hover { color: var(--gold2); }

  /* LIGNE 2 : dés — toujours visible, scroll si besoin */
  .nav-dice {
    display: flex;
    align-items: center;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    height: 40px;
    padding: 0 8px;
  }
  .nav-dice::-webkit-scrollbar { display: none; }
  .site-nav a.die-link {
    color: var(--text-muted);
    text-decoration: none;
    font-family: 'Cinzel Decorative', serif;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    padding: 0 13px;
    height: 40px;
    line-height: 40px;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    flex-shrink: 0;
    transition: all 0.15s;
    -webkit-tap-highlight-color: transparent;
    display: block;
  }
  .site-nav a.die-link:hover { color: var(--gold); border-bottom-color: rgba(201,168,76,0.4); }
  .site-nav a.die-link.active { color: var(--gold2); border-bottom-color: var(--gold); }
  .nav-sep { width: 1px; height: 20px; background: var(--border); flex-shrink: 0; margin: 0 4px; align-self: center; }

  /* Desktop (≥ 700px) : une seule ligne */
  @media (min-width: 700px) {
    .site-nav {
      display: flex;
      flex-direction: row;
      align-items: center;
      height: 46px;
      padding: 0 20px;
    }
    .nav-top { display: contents; }
    .nav-home-label {
      height: 46px;
      line-height: 46px;
      padding-right: 18px;
      border-right: 1px solid var(--border);
      order: 0;
      flex-shrink: 0;
    }
    .nav-dice {
      flex: 1;
      height: 46px;
      padding: 0;
      overflow-x: visible;
      order: 1;
    }
    .site-nav a.die-link { height: 46px; line-height: 46px; }
    .theme-toggle { order: 99; margin-left: auto; }
  }

  /* BREADCRUMB */
  .breadcrumb {
    position: relative; z-index: 10;
    padding: 10px 20px;
    font-size: 0.8rem;
    color: var(--text-muted);
    max-width: 900px;
    margin: 0 auto;
  }
  .breadcrumb a { color: var(--gold); text-decoration: none; opacity: 0.8; }
  .breadcrumb a:hover { opacity: 1; }
  .breadcrumb span { margin: 0 6px; opacity: 0.4; }

  /* HEADER */
  header {
    position: relative; z-index: 10;
    text-align: center;
    padding: 44px 20px 36px;
    border-bottom: 1px solid var(--border);
  }
  .die-hero-icon {
    width: 72px; height: 72px;
    margin: 0 auto 16px;
    color: var(--gold);
    opacity: 0.9;
  }
  .die-hero-icon svg { width: 100%; height: 100%; }
  h1 {
    font-family: 'Cinzel Decorative', serif;
    font-size: clamp(1.8rem, 5vw, 3.2rem);
    font-weight: 900;
    color: var(--gold);
    letter-spacing: 0.05em;
    line-height: 1.1;
    text-shadow: 0 0 40px rgba(201,168,76,0.4);
    margin-bottom: 4px;
  }
  h1 .sub { display: block; font-size: 0.5em; color: var(--text-muted); letter-spacing: 0.2em; margin-bottom: 6px; font-weight: 700; }
  .tagline { font-size: 1rem; color: var(--text-muted); font-style: italic; letter-spacing: 0.05em; }

  /* MAIN */
  main { position: relative; z-index: 1; max-width: 900px; margin: 0 auto; padding: 40px 20px 70px; }

  .section-title {
    font-family: 'Cinzel Decorative', serif;
    font-size: 0.8rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 18px;
    display: flex; align-items: center; gap: 12px;
  }
  .section-title::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--border), transparent); }

  /* ROLLER */
  .roller-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 32px 28px;
    margin-bottom: 48px;
    text-align: center;
  }

  .die-big-icon {
    width: 100px; height: 100px;
    margin: 0 auto 20px;
    color: var(--gold);
    filter: drop-shadow(0 0 16px rgba(201,168,76,0.3));
    transition: transform 0.3s ease;
  }
  .die-big-icon.rolling { animation: spinRoll 0.5s ease; }
  @keyframes spinRoll {
    0% { transform: rotate(0deg) scale(1); }
    25% { transform: rotate(-15deg) scale(1.1); }
    50% { transform: rotate(12deg) scale(0.95); }
    75% { transform: rotate(-8deg) scale(1.05); }
    100% { transform: rotate(0deg) scale(1); }
  }

  .result-value {
    font-family: 'Cinzel Decorative', serif;
    font-size: clamp(3.5rem, 12vw, 6rem);
    color: var(--gold2);
    line-height: 1;
    text-shadow: 0 0 40px rgba(201,168,76,0.5);
    min-height: 1.2em;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.25s ease;
  }
  .result-value.crit { color: #ff6b35; text-shadow: 0 0 40px rgba(255,107,53,0.6); animation: critPop 0.5s ease; }
  .result-value.fumble { color: var(--crimson2); text-shadow: 0 0 30px rgba(192,57,43,0.6); animation: critPop 0.5s ease; }
  @keyframes critPop { 0%,100% { transform: scale(1); } 50% { transform: scale(1.2); } }

  .crit-msg {
    font-family: 'Cinzel Decorative', serif;
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    margin-top: 6px;
    min-height: 1.4em;
  }
  .crit-msg.max { color: var(--gold2); }
  .crit-msg.min { color: var(--crimson2); }

  .count-row {
    display: flex; align-items: center; justify-content: center;
    gap: 0; margin: 24px 0 20px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    width: fit-content;
    margin-left: auto; margin-right: auto;
  }
  .count-btn {
    background: none; border: none;
    color: var(--text-muted);
    font-size: 1.4rem;
    width: 52px; height: 52px;
    cursor: pointer;
    transition: all 0.15s;
    display: flex; align-items: center; justify-content: center;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
  .count-btn:hover { background: var(--border); color: var(--gold); }
  .count-val {
    width: 64px; text-align: center;
    font-family: 'Cinzel Decorative', serif;
    font-size: 1.2rem; color: var(--text);
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    line-height: 52px; height: 52px;
  }
  .count-desc { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 20px; font-style: italic; }

  .roll-btn {
    position: relative;
    background: linear-gradient(135deg, #8b1a1a 0%, #6b1212 100%);
    border: 1px solid rgba(201,168,76,0.3);
    border-radius: 8px;
    color: #e8c96a;
    font-family: 'Cinzel Decorative', serif;
    font-size: 1rem;
    letter-spacing: 0.1em;
    padding: 16px 56px;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 20px rgba(139,26,26,0.4);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
  .roll-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(139,26,26,0.6); border-color: rgba(201,168,76,0.6); }
  .roll-btn:active { transform: translateY(0); }

  /* Multi-dice results */
  .multi-results {
    display: none;
    margin-top: 20px;
  }
  .multi-results.visible { display: block; }
  .multi-total {
    font-family: 'Cinzel Decorative', serif;
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 10px;
  }
  .multi-total strong { color: var(--gold2); font-size: 1.4rem; }
  .dice-chips {
    display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
  }
  .chip {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Cinzel Decorative', serif;
    font-size: 0.95rem;
    color: var(--text);
    animation: chipIn 0.25s ease backwards;
  }
  .chip.hi { border-color: var(--gold); color: var(--gold2); }
  .chip.lo { border-color: var(--crimson); color: var(--crimson2); }
  @keyframes chipIn { from { opacity:0; transform: scale(0.6) rotate(-10deg); } to { opacity:1; transform: scale(1) rotate(0); } }

  /* HISTORY */
  .history-section { margin-top: 40px; padding-top: 32px; border-top: 1px solid var(--border); display: none; }
  .history-list { display: flex; flex-direction: column; gap: 7px; margin-top: 14px; }
  .history-item {
    display: flex; align-items: center; gap: 14px;
    padding: 9px 14px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 6px; font-size: 0.85rem; color: var(--text-muted);
    animation: slideIn 0.2s ease;
  }
  @keyframes slideIn { from { opacity:0; transform: translateX(-8px); } to { opacity:1; transform: translateX(0); } }
  .h-label { font-family: 'Cinzel Decorative', serif; font-size: 0.8rem; color: var(--gold); min-width: 52px; }
  .h-rolls { flex:1; font-size: 0.82rem; }
  .h-total { font-family: 'Cinzel Decorative', serif; font-size: 0.95rem; color: var(--text); }
  .clear-btn {
    background: none; border: 1px solid var(--border); border-radius: 6px;
    color: var(--text-muted); font-family: 'Crimson Pro', serif;
    font-size: 0.82rem; padding: 5px 12px; cursor: pointer; margin-top: 10px;
    transition: all 0.15s;
  }
  .clear-btn:hover { border-color: var(--crimson); color: var(--crimson2); }

  /* INTERNAL LINKS */
  .other-dice-section { margin-top: 48px; padding-top: 36px; border-top: 1px solid var(--border); }
  .dice-links-grid {
    display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px;
  }
  .dice-link {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--text-muted);
    display: flex; align-items: center; gap: 10px;
    font-family: 'Crimson Pro', serif;
    font-size: 0.95rem;
    transition: all 0.2s;
    flex: 1; min-width: 110px;
  }
  .dice-link:hover { border-color: var(--gold); color: var(--gold2); transform: translateY(-1px); }
  .dice-link-icon { width: 28px; height: 28px; flex-shrink: 0; }
  .dice-link-icon svg { width: 100%; height: 100%; }
  .dice-link-label { font-family: 'Cinzel Decorative', serif; font-size: 0.78rem; display: block; color: var(--gold); }
  .dice-link-sub { font-size: 0.78rem; color: var(--text-muted); }

  /* SEO CONTENT */
  .seo-section {
    position: relative; z-index: 1;
    background: var(--bg2);
    border-top: 1px solid var(--border);
    padding: 60px 20px 60px;
  }
  .seo-inner { max-width: 900px; margin: 0 auto; display: flex; flex-direction: column; gap: 44px; }
  .seo-block h2 {
    font-family: 'Cinzel Decorative', serif;
    font-size: 1rem;
    color: var(--gold);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
    letter-spacing: 0.04em;
  }
  .seo-block p { color: var(--text-muted); line-height: 1.78; margin-bottom: 10px; font-size: 1rem; }
  .seo-block p strong { color: var(--text); }
  .usage-list { display: flex; flex-direction: column; gap: 12px; }
  .usage-item {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 8px; padding: 14px 16px;
  }
  .usage-item h3 { font-family: 'Cinzel Decorative', serif; font-size: 0.78rem; color: var(--gold); margin-bottom: 5px; letter-spacing: 0.05em; }
  .usage-item p { font-size: 0.92rem; color: var(--text-muted); line-height: 1.6; margin: 0; }

  /* FAQ */
  .faq-list { display: flex; flex-direction: column; gap: 8px; }
  .faq-item { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; transition: border-color 0.2s; }
  .faq-item[open] { border-color: rgba(201,168,76,0.35); }
  .faq-item summary {
    padding: 14px 18px; cursor: pointer; font-size: 1rem; color: var(--text);
    list-style: none; display: flex; justify-content: space-between; align-items: center;
    user-select: none; -webkit-tap-highlight-color: transparent;
  }
  .faq-item summary::-webkit-details-marker { display: none; }
  .faq-item summary::after { content: '+'; color: var(--gold); font-size: 1.2rem; font-weight: 300; transition: transform 0.2s; flex-shrink: 0; margin-left: 12px; }
  .faq-item[open] summary::after { transform: rotate(45deg); }
  .faq-item p { padding: 0 18px 14px; color: var(--text-muted); font-size: 0.95rem; line-height: 1.7; margin: 0; }

  /* FOOTER */
  footer {
    position: relative; z-index: 1;
    text-align: center; padding: 36px 20px;
    border-top: 1px solid var(--border);
    color: var(--text-muted); font-size: 0.82rem; font-style: italic;
  }
  footer a { color: var(--gold); text-decoration: none; opacity: 0.7; }
  footer a:hover { opacity: 1; }

  /* RESPONSIVE */
  @media (max-width: 400px) {
    header { padding: 28px 16px 22px; }
    .die-hero-icon { width: 52px; height: 52px; }
    h1 { font-size: 1.6rem; }
    main { padding: 28px 14px 56px; }
    .roller-box { padding: 24px 16px; }
    .die-big-icon { width: 72px; height: 72px; }
    .result-value { font-size: 3.5rem; }
    .roll-btn { width: 100%; padding: 16px 20px; }
    .dice-links-grid { gap: 8px; }
    .dice-link { min-width: calc(50% - 4px); padding: 10px 12px; font-size: 0.88rem; }
    .seo-section { padding: 36px 14px 40px; }
  }
  @media (min-width: 400px) and (max-width: 700px) {
    main { padding: 32px 18px 60px; }
    .roller-box { padding: 28px 20px; }
    .roll-btn { width: 100%; }
    .dice-link { min-width: calc(50% - 5px); }
  }
  @media (min-width: 700px) {
    .dice-links-grid { flex-wrap: nowrap; }
    .dice-link { flex: 1; }
    .usage-list { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 12px; }
  }

  /* === INLINE LINKS FIX === */
  .seo-section a, .seo-block a {
    color: var(--gold);
    text-decoration: none;
    border-bottom: 1px solid rgba(201,168,76,0.35);
    transition: border-color 0.15s, color 0.15s;
  }
  .seo-section a:hover, .seo-block a:hover {
    color: var(--gold2);
    border-bottom-color: var(--gold);
  }

  /* === BOUTIQUE CTA === */
  .boutique-cta {
    display: flex;
    align-items: center;
    gap: 14px;
    background: linear-gradient(135deg, rgba(139,26,26,0.18), rgba(139,26,26,0.06));
    border: 1px solid rgba(201,168,76,0.25);
    border-radius: 10px;
    padding: 18px 22px;
    text-decoration: none !important;
    border-bottom: 1px solid rgba(201,168,76,0.25) !important;
    margin-top: 20px;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
  }
  .boutique-cta:hover {
    border-color: rgba(201,168,76,0.5) !important;
    background: linear-gradient(135deg, rgba(139,26,26,0.28), rgba(139,26,26,0.10));
    transform: translateY(-1px);
  }
  .boutique-cta-icon { font-size: 1.6rem; flex-shrink: 0; }
  .boutique-cta-text { display: flex; flex-direction: column; gap: 2px; }
  .boutique-cta-label {
    font-family: 'Cinzel Decorative', serif;
    font-size: 0.82rem;
    color: var(--gold2);
    letter-spacing: 0.06em;
  }
  .boutique-cta-sub { font-size: 0.85rem; color: var(--text-muted); font-style: italic; }


  /* === LIGHT MODE === */
  body.light {
    --bg: #f5f0e8;
    --bg2: #ede7d9;
    --surface: #ffffff;
    --border: #d4c9b0;
    --gold: #8a6a1a;
    --gold2: #6b5014;
    --crimson: #8b1a1a;
    --crimson2: #a52020;
    --text: #1a1510;
    --text-muted: #6b5f4a;
  }

  body.light::before {
    background:
      radial-gradient(ellipse 80% 60% at 20% 20%, rgba(139,26,26,0.04) 0%, transparent 60%),
      radial-gradient(ellipse 60% 80% at 80% 80%, rgba(139,106,26,0.05) 0%, transparent 60%);
  }

  body.light .site-nav { background: rgba(245,240,232,0.97); }
  body.light .roller-box { box-shadow: 0 2px 20px rgba(0,0,0,0.08); }
  body.light .total-display { box-shadow: 0 2px 20px rgba(138,106,26,0.12); }
  body.light .roll-btn { box-shadow: 0 4px 16px rgba(139,26,26,0.25); }
  body.light .seo-section { background: var(--bg2); }
  body.light .die-big-icon { filter: drop-shadow(0 0 10px rgba(138,106,26,0.2)); }
  body.light .result-value { text-shadow: 0 0 20px rgba(138,106,26,0.3); }
  body.light .result-value.crit { color: #c0392b; text-shadow: 0 0 20px rgba(192,57,43,0.4); }

  /* === THEME TOGGLE BUTTON === */
  .theme-toggle {
    
    flex-shrink: 0;
    background: none;
    border: 1px solid var(--border);
    border-radius: 20px;
    cursor: pointer;
    padding: 5px 12px 5px 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-family: 'Cinzel Decorative', serif;
    font-size: 0.65rem;
    letter-spacing: 0.08em;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
  }
  .theme-toggle:hover { border-color: var(--gold); color: var(--gold); }
  
  .theme-toggle .toggle-track {
    width: 28px; height: 16px;
    background: var(--border);
    border-radius: 8px;
    position: relative;
    transition: background 0.2s;
    flex-shrink: 0;
  }
  .theme-toggle .toggle-thumb {
    position: absolute;
    top: 2px; left: 2px;
    width: 12px; height: 12px;
    border-radius: 50%;
    background: var(--gold);
    transition: transform 0.2s, background 0.2s;
  }
  body.light .theme-toggle .toggle-track { background: var(--gold); opacity: 0.4; }
  body.light .theme-toggle .toggle-thumb { transform: translateX(12px); }
  .toggle-icon { font-size: 0.9rem; }


  /* === LIGHT MODE — ROLL BUTTON === */
  body.light .roll-btn {
    background: linear-gradient(135deg, #7a1515 0%, #5c0f0f 100%);
    border-color: rgba(138,106,26,0.5);
    color: #f5e6b0;
    box-shadow: 0 4px 16px rgba(122,21,21,0.3);
  }
  body.light .roll-btn:hover {
    box-shadow: 0 8px 28px rgba(122,21,21,0.45);
    border-color: rgba(138,106,26,0.8);
  }

  /* ═══ FOOTER TROIS COLONNES ═══ */
  footer {
    position: relative; z-index: 1;
    padding: 40px 20px;
    border-top: 1px solid var(--border);
    color: var(--text-muted); font-size: 0.85rem;
  }
  .footer-inner {
    max-width: 900px; margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 32px;
  }
  .footer-col h3 {
    font-family: 'Cinzel Decorative', serif;
    font-size: 0.7rem; letter-spacing: 0.2em;
    color: var(--gold); margin-bottom: 12px; text-transform: uppercase;
  }
  .footer-links { display: flex; flex-direction: column; gap: 8px; }
  .footer-links a { color: var(--text-muted); text-decoration: none; font-size: 0.9rem; transition: color 0.15s; }
  .footer-links a:hover { color: var(--gold); }
  .footer-bottom {
    max-width: 900px; margin: 24px auto 0;
    padding-top: 20px; border-top: 1px solid var(--border);
    text-align: center; font-size: 0.8rem; font-style: italic;
  }
  .footer-bottom a { color: var(--gold); text-decoration: none; opacity: 0.7; }
  .footer-bottom a:hover { opacity: 1; }
  @media (max-width: 600px) {
    .footer-inner { grid-template-columns: 1fr 1fr 1fr 1fr; gap: 24px; }
  }
  @media (max-width: 360px) {
    .footer-inner { grid-template-columns: 1fr; }
  }
