/* ════════════════════════════════════════════════════════════════
   app_themes.css — 6 NOUVEAUX THÈMES DE COULEUR pour l'app-shell
   ----------------------------------------------------------------
   À CHARGER **APRÈS** css/app.css sur toutes les pages :
       <link rel="stylesheet" href="../css/app.css">
       <link rel="stylesheet" href="../css/app_themes.css">

   PRINCIPE (identique aux thèmes existants)
   -----------------------------------------
   Un thème = un jeu des ~15 variables CSS de app.css, posé sur <html>
   via une classe d'identité « html.theme-<id> ». theme.js applique la
   classe ; tous les composants héritent sans modification.

   FAMILLES
   --------
     • Sombre  (dark)   : pas de classe .theme-light → garde ombres + halos.
                          → obsidienne · emeraude · amethyste · crepuscule
     • Clair   (light)  : porte AUSSI .theme-light → hérite des correctifs
                          structurels clairs (pas d'ombres/halos).
                          → velin · ardoise

   Les 3 thèmes d'origine (dark = :root, light, parchment) NE SONT PAS
   TOUCHÉS. Ce fichier est purement additif.

   ⚠ FONDS CODÉS EN DUR : app.css fixe quelques fonds en hexadécimal hors
   variables (.topbar, .hub-game-card…). Le bloc « RE-ROUTAGE » plus bas
   les renvoie vers les variables pour les 4 thèmes sombres. (Les thèmes
   clairs sont déjà couverts par les règles « html.theme-light .xxx » de
   app.css.) Idéalement : migrer ces fonds vers les variables dans app.css
   et supprimer ce bloc (voir INTEGRATION.md).
   ════════════════════════════════════════════════════════════════ */


/* ╔══════════════════════════════════════════════════════════════╗
   ║ 1 · OBSIDIENNE & OR — sombre premium, anthracite froid + or net ║
   ╚══════════════════════════════════════════════════════════════╝ */
html.theme-obsidienne {
    --gold:           #E3B23C;
    --gold-light:     #F6D684;
    --gold-dark:      #9C7A22;
    --gold-glow:      rgba(227,178,60,0.30);
    --crimson:        #C0432E;
    --crimson-light:  #D8543C;
    --bg-void:        #0C0E13;
    --bg-panel:       #141821;
    --bg-card:        #1B212C;
    --bg-hover:       #222B39;
    --border-dark:    #283041;
    --border-gold:    #3B455A;
    --text-parchment: #ECE9E1;
    --text-muted:     #9AA1B0;
    --text-dim:       #5C6677;
}
html.theme-obsidienne body {
    background-color: var(--bg-void);
    background-image:
        radial-gradient(ellipse at 18% 36%, rgba(227,178,60,.07) 0%, transparent 58%),
        radial-gradient(ellipse at 84% 16%, rgba(120,140,180,.06) 0%, transparent 52%);
    background-attachment: fixed;
}

/* ╔══════════════════════════════════════════════════════════════╗
   ║ 2 · NOCTURNE ÉMERAUDE — sombre joaillier, vert profond + laiton ║
   ╚══════════════════════════════════════════════════════════════╝ */
html.theme-emeraude {
    --gold:           #CBA35A;
    --gold-light:     #ECD292;
    --gold-dark:      #8A6E30;
    --gold-glow:      rgba(58,160,120,0.26);
    --crimson:        #C0432E;
    --crimson-light:  #D8543C;
    --bg-void:        #08130D;
    --bg-panel:       #0C1D15;
    --bg-card:        #103025;
    --bg-hover:       #163A2C;
    --border-dark:    #1C3D30;
    --border-gold:    #2C5D49;
    --text-parchment: #E4EDE6;
    --text-muted:     #8AA596;
    --text-dim:       #506B5D;
}
html.theme-emeraude body {
    background-color: var(--bg-void);
    background-image:
        radial-gradient(ellipse at 18% 38%, rgba(58,160,120,.10) 0%, transparent 58%),
        radial-gradient(ellipse at 84% 16%, rgba(203,163,90,.06) 0%, transparent 50%);
    background-attachment: fixed;
}

/* ╔══════════════════════════════════════════════════════════════╗
   ║ 3 · AMÉTHYSTE NOCTURNE — sombre arcanique, indigo-violet + cyan ║
   ╚══════════════════════════════════════════════════════════════╝ */
html.theme-amethyste {
    --gold:           #9B7BE0;
    --gold-light:     #C4ADF2;
    --gold-dark:      #6A4EB0;
    --gold-glow:      rgba(125,90,220,0.30);
    --crimson:        #C0432E;
    --crimson-light:  #D8543C;
    --bg-void:        #0D0A1C;
    --bg-panel:       #161130;
    --bg-card:        #1F1742;
    --bg-hover:       #281E52;
    --border-dark:    #2E2356;
    --border-gold:    #463A78;
    --text-parchment: #E6E0F5;
    --text-muted:     #9B8FC4;
    --text-dim:       #5D5188;
}
html.theme-amethyste body {
    background-color: var(--bg-void);
    background-image:
        radial-gradient(ellipse at 18% 36%, rgba(125,90,220,.12) 0%, transparent 58%),
        radial-gradient(ellipse at 84% 18%, rgba(79,208,224,.07) 0%, transparent 52%);
    background-attachment: fixed;
}

/* ╔══════════════════════════════════════════════════════════════╗
   ║ 4 · VÉLIN — clair éditorial, ivoire net + encre + rouge de cire ║
   ║   (famille CLAIRE : theme.js ajoute AUSSI .theme-light)         ║
   ╚══════════════════════════════════════════════════════════════╝ */
html.theme-velin {
    --gold:           #B33A2B;   /* accent = rouge de cire (titres, liens)  */
    --gold-light:     #8F2C20;   /* variante foncée lisible (convention clair)*/
    --gold-dark:      #D98C7A;
    --gold-glow:      rgba(179,58,43,0.12);
    --crimson:        #9B2020;
    --crimson-light:  #C03030;
    --bg-void:        #F7F3EA;
    --bg-panel:       #FFFDF8;
    --bg-card:        #FFFFFF;
    --bg-hover:       #F0EBDF;
    --border-dark:    #E2DCCB;
    --border-gold:    #D3CBB4;
    --text-parchment: #20201C;
    --text-muted:     #6E6A5E;
    --text-dim:       #A09A88;
}
html.theme-velin body {
    background-color: var(--bg-void);
    background-image:
        radial-gradient(ellipse at 82% 14%, rgba(179,58,43,.04) 0%, transparent 55%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.012'/%3E%3C/svg%3E");
    background-attachment: fixed, fixed;
}
html.theme-velin .topbar { background: linear-gradient(180deg, #FFFDF8, #F3EEE2); }

/* ╔══════════════════════════════════════════════════════════════╗
   ║ 5 · ARDOISE — clair froid, papier bleuté + ardoise + bleu acier ║
   ║   (famille CLAIRE : theme.js ajoute AUSSI .theme-light)         ║
   ╚══════════════════════════════════════════════════════════════╝ */
html.theme-ardoise {
    --gold:           #2F6F9E;   /* accent = bleu acier */
    --gold-light:     #235780;
    --gold-dark:      #8FB4CF;
    --gold-glow:      rgba(47,111,158,0.14);
    --crimson:        #9B2020;
    --crimson-light:  #C03030;
    --bg-void:        #EEF1F4;
    --bg-panel:       #F8FAFB;
    --bg-card:        #FFFFFF;
    --bg-hover:       #E3E9EE;
    --border-dark:    #D6DDE3;
    --border-gold:    #C2CCD4;
    --text-parchment: #20262B;
    --text-muted:     #5F6B75;
    --text-dim:       #97A3AD;
}
html.theme-ardoise body {
    background-color: var(--bg-void);
    background-image:
        radial-gradient(ellipse at 18% 36%, rgba(47,111,158,.06) 0%, transparent 58%);
    background-attachment: fixed;
}
html.theme-ardoise .topbar { background: linear-gradient(180deg, #F6F8FA, #E6EBEF); }

/* ╔══════════════════════════════════════════════════════════════╗
   ║ 6 · CRÉPUSCULE — graphique, dégradé prune → braise plein cadre  ║
   ║   (famille SOMBRE : fond en dégradé fixe sur tout le viewport)  ║
   ╚══════════════════════════════════════════════════════════════╝ */
html.theme-crepuscule {
    --gold:           #FFB35C;
    --gold-light:     #FFD08A;
    --gold-dark:      #C97A3A;
    --gold-glow:      rgba(255,150,80,0.35);
    --crimson:        #E0563C;
    --crimson-light:  #FF6A4A;
    --bg-void:        #2A1438;
    --bg-panel:       #1C0E1F;
    --bg-card:        #2E1828;
    --bg-hover:       #3C2030;
    --border-dark:    #4A2A3A;
    --border-gold:    #7A4A48;
    --text-parchment: #F6E7D8;
    --text-muted:     #D3A98F;
    --text-dim:       #A07A6A;
}
html.theme-crepuscule body {
    background-color: var(--bg-void);
    background-image: linear-gradient(150deg, #2A1438 0%, #51223A 46%, #7A3322 100%);
    background-attachment: fixed;
}
html.theme-crepuscule .topbar {
    background: linear-gradient(180deg, rgba(40,16,40,.92), rgba(64,26,42,.78));
}


/* ════════════════════════════════════════════════════════════════
   RE-ROUTAGE des fonds codés en dur (thèmes SOMBRES uniquement)
   ----------------------------------------------------------------
   app.css fixe ces fonds en hexadécimal (valeurs du thème sombre
   d'origine). On les renvoie vers les variables pour que les nouveaux
   thèmes sombres s'appliquent partout. À étendre si vous trouvez
   d'autres fonds codés en dur (cf. INTEGRATION.md § audit).
   ════════════════════════════════════════════════════════════════ */
html.theme-obsidienne .topbar,
html.theme-emeraude   .topbar,
html.theme-amethyste  .topbar {
    background: linear-gradient(180deg, var(--bg-panel), var(--bg-void));
    border-bottom-color: var(--border-gold);
}
html.theme-obsidienne .hub-game-card,
html.theme-emeraude   .hub-game-card,
html.theme-amethyste  .hub-game-card,
html.theme-crepuscule .hub-game-card {
    background: linear-gradient(160deg, var(--bg-card), var(--bg-void));
    border-color: var(--border-gold);
}
html.theme-obsidienne .hub-game-card:hover,
html.theme-emeraude   .hub-game-card:hover,
html.theme-amethyste  .hub-game-card:hover,
html.theme-crepuscule .hub-game-card:hover {
    border-color: var(--gold);
    box-shadow: 0 0 30px rgba(0,0,0,.6), 0 0 12px var(--gold-glow);
}


/* ════════════════════════════════════════════════════════════════
   MENUS DÉROULANTS — sélecteur de thème (9) & d'agencement (7)
   Créés par theme.js / layout.js (non stylés là-bas). Utilisent les
   variables de thème → cohérents avec les 9 couleurs.
   ════════════════════════════════════════════════════════════════ */
.theme-menu, .layout-menu{
  background:var(--bg-card); border:1px solid var(--border-gold);
  border-radius:10px; padding:6px; min-width:200px; z-index:9000;
  box-shadow:0 12px 32px rgba(0,0,0,.45);
}
.theme-menu-group{ font:700 9px/1 'Cinzel',serif; letter-spacing:.14em;
  text-transform:uppercase; color:var(--text-dim); padding:8px 10px 4px; }
.theme-menu-item,.layout-menu-item{ display:flex; gap:9px; align-items:center;
  width:100%; text-align:left; background:none; border:0; cursor:pointer;
  color:var(--text-parchment); font:14px 'Crimson Text',serif;
  padding:8px 10px; border-radius:7px; }
.theme-menu-item:hover,.layout-menu-item:hover{ background:var(--bg-hover); }
.theme-menu-item.on,.layout-menu-item.on{ color:var(--gold-light); }
.layout-menu-item .lm-tx{ display:flex; flex-direction:column; }
.layout-menu-item .lm-ic{ font-size:17px; width:22px; text-align:center; }
.layout-menu-item .lm-tx small{ color:var(--text-muted); font-size:11.5px; font-style:italic; }


/* ════════════════════════════════════════════════════════════════
   MENU ⚙ OPTIONS UNIFIÉ (options_menu.js) — Thème + Disposition
   Présent sur toutes les pages. Utilise les variables de thème.
   ════════════════════════════════════════════════════════════════ */
.om-gear{
  background:none; border:1px solid var(--border-gold); color:var(--text-parchment);
  width:34px; height:34px; min-width:34px; border-radius:8px; cursor:pointer;
  font-size:16px; line-height:1; margin-left:auto; flex-shrink:0;
}
.om-gear:hover{ border-color:var(--gold); color:var(--gold-light); }
.om-gear-float{ position:fixed; top:10px; right:12px; z-index:9000; background:var(--bg-card); margin:0; }
.om-panel{
  background:var(--bg-card); border:1px solid var(--border-gold); border-radius:10px;
  padding:8px; min-width:232px; max-width:300px; z-index:9300;
  box-shadow:0 12px 32px rgba(0,0,0,.45); max-height:82vh; overflow:auto;
}
.om-sec-label{
  font:700 10px/1 'Cinzel',serif; letter-spacing:.12em; text-transform:uppercase;
  color:var(--gold); padding:9px 6px 5px;
}
.om-subsec{
  font-size:9px; letter-spacing:.1em; text-transform:uppercase;
  color:var(--text-dim); padding:4px 6px 3px;
}
.om-grid{ display:grid; grid-template-columns:1fr 1fr; gap:4px; }
.om-grid-1{ grid-template-columns:1fr; }
.om-item{
  display:flex; align-items:center; gap:7px; width:100%; text-align:left;
  background:none; border:1px solid transparent; border-radius:7px;
  color:var(--text-parchment); font:13px 'Crimson Text',serif; padding:7px 9px; cursor:pointer;
}
.om-item:hover{ background:var(--bg-hover); }
.om-item.on{ border-color:var(--gold); color:var(--gold-light); }
.om-ic{ width:18px; text-align:center; flex-shrink:0; }
.om-extra{ padding-bottom:6px; margin-bottom:4px; border-bottom:1px solid var(--border-dark); }
