/* =====================================================================================================================
   RAM Clicker — feuille de style (v44 : style épuré ; accent vert depuis la v46)
   Principes : beaucoup d'espace, une seule couleur d'accent (vert), la police du système, des cartes blanches sans bordure
   sur un fond gris très clair, des boutons « pilule » pour les actions principales, aucun halo lumineux.
   La barrette à cliquer est mise en avant comme un produit : grande, au centre, avec une ombre douce.
   Thèmes : couleurs en variables. Sans choix du joueur, le site suit le thème clair / sombre de l'appareil (common.js).
   ===================================================================================================================== */
:root { --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI Variable Text", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
        --radius: 18px; --radiusSm: 12px; --pill: 980px;
        --bg: #f5f5f7; --panel: #ffffff; --panel2: #f5f5f7; --btn: #f0f0f3; --btnHover: #e6e6eb; --line: #e8e8ed; --line2: #d2d2d7;
        --text: #1d1d1f; --text2: #424245; --muted2: #6e6e73; --muted: #86868b; --strong: #1d1d1f;
        --accent: #0f8a52; --accentHover: #0c7a48; --onAccent: #ffffff; --ring: rgba(15, 138, 82, .28);   /* vert des versions précédentes */
        --okbg: #e8f6ee; --okbg2: #f1faf5; --okline: #9fd9b9;
        --gold: #b64400; --goldbg: #fff4ea; --bad: #e30000; --badtext: #c40000; --badbg: #fff1f0; --badbg2: #ffe5e3;
        --blue: #0071e3; --bluetext: #0066cc; --bluebg: #eef5fe; --warn: #b64400; --warnbg: #fff4ea; --blue2: #0066cc;
        --shadow: 0 4px 24px rgba(0, 0, 0, .06); --shadowPop: 0 24px 60px rgba(0, 0, 0, .18);
        --glass: rgba(251, 251, 253, .8); --toast: rgba(29, 29, 31, .94); color-scheme: light; }
:root[data-theme="dark"] { --bg: #000000; --panel: #161617; --panel2: #1d1d1f; --btn: #262628; --btnHover: #303033; --line: #2a2a2d; --line2: #3a3a3c;
        --text: #f5f5f7; --text2: #d2d2d7; --muted2: #a1a1a6; --muted: #86868b; --strong: #ffffff;
        --accent: #3ddc84; --accentHover: #5ee59a; --onAccent: #04200f; --ring: rgba(61, 220, 132, .35);   /* vert : texte sombre dessus (lisible) */
        --okbg: #10261b; --okbg2: #0b1a12; --okline: #2b6b48;
        --gold: #ff9f0a; --goldbg: #2b1d06; --bad: #ff453a; --badtext: #ff6961; --badbg: #2c0f0d; --badbg2: #3a1411;
        --blue: #2997ff; --bluetext: #6cb6ff; --bluebg: #0b2238; --warn: #ff9f0a; --warnbg: #2b1d06; --blue2: #6cb6ff;
        --shadow: none; --shadowPop: 0 24px 60px rgba(0, 0, 0, .6);
        --glass: rgba(22, 22, 23, .8); --toast: rgba(245, 245, 247, .96); color-scheme: dark; }
:root[data-theme="dark"] #toast { color: #1d1d1f; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.47 var(--font);   /* 16 px (v47) : aussi lisible que l'ancienne police à chasse fixe */ letter-spacing: -.01em;
       -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
       -webkit-user-select: none; user-select: none; }      /* pas de texte surligné en cliquant vite ; les champs et le code restent sélectionnables */
input, textarea, [contenteditable] { -webkit-user-select: text; user-select: text; }
h1 { margin: 0; padding: 12px 16px; color: var(--strong); font-size: 21px; font-weight: 600; letter-spacing: -.02em; }
h2 { margin: 0 0 14px; font-size: 23px; font-weight: 600; color: var(--strong); letter-spacing: -.02em; line-height: 1.2; }
h2 small { font-size: 15px; font-weight: 400; letter-spacing: -.01em; }
main { display: grid; grid-template-columns: 1fr 1.4fr 1fr; gap: 20px; max-width: 1840px; margin: 0 auto; padding: 20px; align-items: start; }   /* presque toute la largeur, comme avant la v44 */
@media (max-width: 900px) { main { grid-template-columns: 1fr; padding: 16px; gap: 16px; } }
section { background: var(--panel); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
@media (max-width: 600px) { section { padding: 18px; } }

/* Compteur : grand chiffre, sobre (comme le titre d'une page produit) */
#mo { margin-top: 6px; font-size: 58px; font-weight: 600; line-height: 1.05; letter-spacing: -.035em; color: var(--strong); text-align: center;
      font-variant-numeric: tabular-nums; }
#ps { margin: 6px 0 14px; text-align: center; color: var(--muted2); font-size: 15px; font-variant-numeric: tabular-nums; }
@media (max-width: 600px) { #mo { font-size: 42px; } }

/* Bouton de clic = une vraie barrette de RAM : circuit imprimé, 5 puces, contacts dorés avec l'encoche */
#chip { position: relative; display: flex; justify-content: center; gap: 7px; width: 280px; max-width: 100%; height: 116px; margin: 22px auto 30px; padding: 16px 12px 0;
        background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .035) 0 1px, transparent 1px 10px),
                    repeating-linear-gradient(0deg, rgba(0, 0, 0, .08) 0 1px, transparent 1px 12px),
                    var(--pcb);
        border: 1px solid var(--pcbEdge); border-radius: 8px 8px 3px 3px; cursor: pointer; user-select: none; touch-action: manipulation;
        box-shadow: 0 18px 36px -12px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .18), inset 0 -10px 18px rgba(0, 0, 0, .18);
        transition: transform .2s cubic-bezier(.2, .8, .2, 1), box-shadow .2s; }
#chip:hover:not(:disabled) { transform: translateY(-3px);
        box-shadow: 0 26px 44px -14px rgba(0, 0, 0, .4), inset 0 1px 0 rgba(255, 255, 255, .22), inset 0 -10px 18px rgba(0, 0, 0, .18); }
#chip.hit { transform: translateY(1px) scale(.975); box-shadow: 0 8px 18px -8px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .1); transition-duration: .05s; }
#chip:focus-visible { outline: 3px solid var(--ring); outline-offset: 4px; }
/* Les puces mémoire (avec un reflet et un petit marquage gravé) */
#chip span { position: relative; width: 38px; height: 42px; border-radius: 3px;
             background: var(--chipC);
             box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 2px 3px rgba(0, 0, 0, .55); }
#chip span::after { content: ''; position: absolute; left: 6px; right: 6px; top: 8px; height: 2px; border-radius: 1px;
                    background: rgba(255, 255, 255, .13); box-shadow: 0 6px 0 rgba(255, 255, 255, .08), 0 12px 0 rgba(255, 255, 255, .05); }
#chip span:first-child::before { content: ''; position: absolute; left: 4px; top: 4px; width: 4px; height: 4px; border-radius: 50%; background: rgba(255, 255, 255, .2); }
/* Le texte, sur une bande sérigraphiée au-dessus des contacts */
#chip b { position: absolute; left: 0; right: 0; bottom: 21px; text-align: center; font-size: 10px; font-weight: 600; letter-spacing: .16em; color: rgba(255, 255, 255, .88); }
/* Contacts dorés en bas, coupés par l'encoche (comme sur une vraie barrette) */
#chip::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: 0; height: 13px; border-radius: 0 0 2px 2px;
               background: repeating-linear-gradient(90deg, #f0c650 0 4px, #b8892a 4px 5px, transparent 5px 8px);
               -webkit-mask: linear-gradient(90deg, #000 0 47%, transparent 47% 53%, #000 53%); mask: linear-gradient(90deg, #000 0 47%, transparent 47% 53%, #000 53%); }
/* Petite LED d'activité qui s'allume à chaque clic */
#chip::before { content: ''; position: absolute; right: 9px; top: 6px; width: 5px; height: 5px; border-radius: 50%; background: #1f4d33; }
#chip.hit::before { background: #7dffb5; }

/* Grand écran : barrette plus grande (la colonne est plus large depuis la v47) */
@media (min-width: 1200px) {
  #chip { width: 330px; height: 136px; gap: 9px; padding-top: 19px; }
  #chip span { width: 46px; height: 50px; }
  #chip b { bottom: 24px; font-size: 11px; }
  main .chipWrap { width: 330px; }   /* « main » : passe devant la règle .chipWrap écrite plus bas */
}

/* Porte-clé accroché au coin haut droit de la barrette : anneau, petite chaîne, breloque (qui se balance à chaque clic) */
.chipWrap { position: relative; width: 280px; max-width: 100%; margin: 0 auto; }
.keychain { position: absolute; right: -14px; top: 4px; display: flex; flex-direction: column; align-items: center; width: 34px;
            text-decoration: none; transform-origin: 50% 4px; z-index: 2; }
.keychain:hover { filter: brightness(1.1); }
.kcRing { width: 14px; height: 14px; border: 3px solid #c8ccd2; border-radius: 50%; box-shadow: 0 1px 2px rgba(0, 0, 0, .4), inset 0 1px 1px rgba(255, 255, 255, .5); }
.kcChain { width: 3px; height: 12px; margin-top: -2px; background: repeating-linear-gradient(180deg, #c8ccd2 0 3px, #7d838b 3px 4px); }
.kcCharm { display: grid; place-items: center; width: 32px; height: 32px; margin-top: -1px; font-size: 19px; line-height: 1;
           background: var(--panel); border: 1px solid var(--line2); border-radius: 10px; box-shadow: 0 4px 10px rgba(0, 0, 0, .12); }
.keychain.empty { opacity: .6; }
.keychain.empty .kcCharm { font-size: 16px; color: var(--muted); border-style: dashed; background: transparent; box-shadow: none; }
.keychain.swing { animation: kcSwing .6s ease-out; }
@keyframes kcSwing { 0% { transform: rotate(0); } 20% { transform: rotate(14deg); } 45% { transform: rotate(-9deg); } 70% { transform: rotate(4deg); } 100% { transform: rotate(0); } }
@media (prefers-reduced-motion: reduce) { .keychain.swing { animation: none; } }
/* Page Succès : choix du porte-clé */
.keyGrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.keyTile { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 16px 12px; text-align: center; }
.keyTile .kcCharm { margin-bottom: 6px; }
.keyTile.on { border-color: var(--accent); background: var(--okbg); }
.keyTile:disabled { opacity: .5; cursor: default; }
.keyTile.on:disabled { opacity: 1; }
.keyNote { margin: 0 0 12px; color: var(--muted2); }

/* Notification « nouvelle mise à jour » (en bas à droite, à la connexion) */
.updateNotice { position: fixed; right: 20px; bottom: 20px; z-index: 40; width: 320px; max-width: calc(100vw - 40px); padding: 18px 20px;
                background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadowPop); border: 1px solid var(--line);
                animation: noticeIn .35s cubic-bezier(.2, .8, .2, 1); }
@keyframes noticeIn { from { transform: translateY(16px); } }
.updateNotice b { color: var(--strong); }
.updateNotice ul { margin: 8px 0 12px; padding-left: 18px; font-size: 13px; color: var(--text2); }
.updateNotice .btn { display: block; text-align: center; }
.updateClose { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; padding: 0; text-align: center; border: 0; border-radius: 50%; background: transparent; color: var(--muted); }
.updateClose:hover:not(:disabled) { color: var(--text); background: var(--btn); }

/* Barrette dorée (apparaît au hasard, à toucher vite) */
.goldenRam { position: fixed; z-index: 55; display: flex; gap: 3px; align-items: center; justify-content: center; width: 86px; height: 34px; margin: -17px 0 0 -43px; padding: 0 6px 6px;
             background: linear-gradient(180deg, #ffe27a, #e2a91c 60%, #b8800f); border: 1px solid #fff2b0; border-radius: 5px 5px 2px 2px; cursor: pointer;
             box-shadow: 0 10px 24px -6px rgba(180, 120, 0, .55), 0 0 0 6px rgba(255, 210, 80, .18); animation: goldenFloat 1.6s ease-in-out infinite; }
.goldenRam span { width: 14px; height: 14px; border-radius: 2px; background: linear-gradient(160deg, #6b4a06, #3a2702); }
.goldenRam:hover:not(:disabled) { border-color: #fff; background: linear-gradient(180deg, #ffe27a, #e2a91c 60%, #b8800f); }
@keyframes goldenFloat { 50% { transform: translateY(-6px) rotate(-4deg); } }
/* Barrettes rares : platine (8 %), prismatique (2,5 %), cosmique (0,5 %) */
.goldenRam.tier-platinum { background: linear-gradient(180deg, #ffffff, #c9d3de 55%, #8e9aa8); border-color: #ffffff;
             box-shadow: 0 10px 24px -6px rgba(80, 110, 150, .55), 0 0 0 6px rgba(190, 225, 255, .3); }
.goldenRam.tier-platinum span { background: linear-gradient(160deg, #4b5866, #232a32); }
.goldenRam.tier-prism { background: linear-gradient(90deg, #ff3b6b, #ffb13b, #4cff7a, #3bc8ff, #a35bff, #ff3b6b); background-size: 300% 100%; border-color: #fff;
             box-shadow: 0 10px 24px -6px rgba(120, 60, 200, .5), 0 0 0 6px rgba(163, 91, 255, .2);
             animation: goldenFloat 1.3s ease-in-out infinite, rgbFlow 2s linear infinite; }
.goldenRam.tier-prism span { background: linear-gradient(160deg, #2b2b3a, #0f0f18); }
.goldenRam.tier-cosmic { width: 96px; height: 38px; margin: -19px 0 0 -48px; border-color: #e6d7ff;
             background: radial-gradient(circle at 15% 30%, #fff 0 1px, transparent 2px), radial-gradient(circle at 55% 75%, #fff 0 1px, transparent 2px),
                         radial-gradient(circle at 85% 25%, #ffe9a3 0 1.5px, transparent 2.5px), radial-gradient(ellipse at 50% 40%, rgba(163, 91, 255, .9), transparent 70%),
                         linear-gradient(180deg, #1b0c4a, #05021a);
             animation: goldenFloat 1.1s ease-in-out infinite, cosmicPulse 1.1s ease-in-out infinite; }
.goldenRam.tier-cosmic span { background: linear-gradient(160deg, #3a2470, #120830); }
@keyframes cosmicPulse { 0%, 100% { box-shadow: 0 10px 24px -6px rgba(60, 20, 140, .6), 0 0 0 4px rgba(200, 150, 255, .25); }
                         50% { box-shadow: 0 10px 24px -6px rgba(60, 20, 140, .6), 0 0 0 12px rgba(200, 150, 255, .12); } }
@media (prefers-reduced-motion: reduce) { .goldenRam { animation: none !important; } }

/* Bonus en cours (sous le compteur) */
.boosts { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: -4px 0 8px; }
.bst { padding: 4px 12px; font-size: 13px; font-weight: 500; border-radius: var(--pill); }
.bst.frenzy { color: #8a5a00; background: #fff3d1; }
.bst.welcome { color: var(--bluetext); background: var(--bluebg); }
.bst.starter { color: var(--accent); background: var(--okbg); }
:root[data-theme="dark"] .bst.frenzy { color: #ffd36b; background: #33280a; }

/* Quêtes du jour (page principale) */
.quest { margin-bottom: 10px; padding: 14px 16px; background: var(--panel2); border: 1px solid transparent; border-radius: var(--radiusSm); }
.quest.done { border-color: var(--accent); background: var(--okbg2); }
.quest.claimed { opacity: .5; }
.quest .qBar { height: 4px; margin: 10px 0 8px; background: var(--line2); border-radius: 2px; overflow: hidden; }
.quest .qBar span { display: block; height: 100%; background: var(--accent); border-radius: 2px; }
.quest button { margin-top: 4px; text-align: center; }
.questFoot { font-size: 13px; color: var(--muted2); }

/* Logo (lien vers la page principale) et titre de la page */
.brand { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; color: inherit; text-decoration: none; border-radius: 10px; padding: 2px 6px 2px 2px; transition: opacity .15s; }
.brand:hover { opacity: .75; }
.brandIcon { width: 36px; height: 22px; flex: 0 0 auto; }
.brandName { font-size: 17px; font-weight: 600; letter-spacing: -.02em; color: var(--strong); white-space: nowrap; }
.brandName b { margin-left: .25em; font-weight: 400; color: var(--muted2); }
.loginBrand { display: flex; align-items: center; justify-content: center; gap: 10px; }

/* Boutons : surfaces douces, sans bordure visible ; la bordure ne sert qu'à marquer un état (choisi, prêt…) */
button { font: inherit; color: inherit; background: var(--btn); border: 1px solid transparent; border-radius: var(--radiusSm);
         padding: 10px 14px; text-align: left; cursor: pointer; width: 100%; transition: background .15s, border-color .15s, transform .1s; }
button:hover:not(:disabled) { background: var(--btnHover); }
button:active:not(:disabled) { transform: scale(.985); }
button:focus-visible, .btn:focus-visible, a:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }
button:disabled { opacity: .4; cursor: not-allowed; }
small { color: var(--muted2); }
i { color: var(--accent); font-style: normal; }
a { color: var(--accent); }

/* Composants : une carte par ligne. À gauche l'achat, à droite l'amélioration DU MÊME composant, reliés par le ⚡ du milieu */
.rowHead { display: grid; grid-template-columns: 1.3fr 26px 1fr; margin: 0 0 8px; font-size: 12px; color: var(--muted); }
.row { display: grid; grid-template-columns: 1.3fr 26px 1fr; align-items: stretch; margin-bottom: 10px; background: var(--panel2); border: 1px solid transparent; border-radius: var(--radiusSm); overflow: hidden; transition: border-color .15s; }
.row:hover { border-color: var(--line2); }
.row.tiered { box-shadow: inset 3px 0 0 var(--gold); }
.row > button { margin: 0; border: 0; border-radius: 0; background: transparent; padding: 12px 14px; }
.row > button:hover:not(:disabled) { background: var(--btn); }
.row .tierBtn { background: transparent; }
.rowLink { position: relative; display: flex; align-items: center; justify-content: center; background: linear-gradient(90deg, transparent 0 45%, var(--line2) 45% 55%, transparent 55%) center / 100% 1px no-repeat; }
.rowLink::before, .rowLink::after { content: ''; position: absolute; left: 50%; width: 1px; background: var(--line2); }
.rowLink::before { top: 0; height: 28%; }
.rowLink::after { bottom: 0; height: 28%; }
.rowLink span { z-index: 1; display: flex; align-items: center; justify-content: center; width: 22px; height: 22px; font-size: 11px; background: var(--panel); border: 1px solid var(--line2); border-radius: 50%; }
.row:hover .rowLink span, .row.tiered .rowLink span { border-color: var(--gold); }
.tierBadge { font-size: 12px; color: var(--gold); }
.boost { color: var(--accent); }
.pips { display: flex; gap: 3px; margin-top: 6px; }
.pips i { flex: 1; max-width: 14px; height: 4px; border-radius: 2px; background: var(--line2); }
.pips i.on { background: var(--gold); }
.max { color: var(--accent); align-self: center; text-align: center; }
.row .max { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 8px; }
/* Sélecteur de quantité : contrôle segmenté */
.qty { display: flex; gap: 2px; margin-bottom: 14px; padding: 3px; background: var(--btn); border-radius: var(--radiusSm); }
.qty button { text-align: center; padding: 7px 4px; background: transparent; border-radius: 9px; font-size: 14px; }
.qty .on { background: var(--panel); color: var(--strong); font-weight: 600; box-shadow: 0 1px 4px rgba(0, 0, 0, .12); }
:root[data-theme="dark"] .qty .on { background: #48484a; }
#upgrades button { margin-bottom: 8px; }
/* Action principale : bouton « pilule » bleu */
#reboot, form button[type=submit], .modalButtons .primary { text-align: center; background: var(--accent); color: var(--onAccent); border-radius: var(--pill); font-weight: 500; }
#reboot:hover:not(:disabled), form button[type=submit]:hover:not(:disabled), .modalButtons .primary:hover:not(:disabled) { background: var(--accentHover); }
#reboot { margin-top: 18px; padding: 12px 18px; transition: transform .1s; }   /* pas de fondu de couleur : il restait bleu pâle au chargement */
#reboot:disabled { background: var(--btn); color: var(--muted2); opacity: 1; }
#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 90; max-width: min(560px, calc(100vw - 32px)); background: var(--toast); color: #f5f5f7;
         padding: 12px 20px; border-radius: 14px; font-size: 14px; box-shadow: var(--shadowPop); display: none;
         -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); }

/* Nombre qui s'envole à chaque clic */
.float { position: fixed; pointer-events: none; color: var(--strong); font-weight: 600; font-size: 15px;
         transform: translate(-50%, -50%); animation: rise .9s cubic-bezier(.2, .8, .2, 1) forwards; z-index: 10; }
@keyframes rise { to { transform: translate(-50%, -110px); opacity: 0; } }

/* Succès */
h2.spaced { margin-top: 24px; }
.ach { padding: 12px 14px; margin-bottom: 0; border-radius: var(--radiusSm); background: var(--panel2); font-size: 13px; opacity: .45; }
.ach.done { opacity: 1; background: var(--okbg2); }
.ach b { color: var(--strong); }

/* Export / import de sauvegarde */
.saves { margin-top: 12px; display: grid; gap: 8px; }
.btn { display: block; font: inherit; color: inherit; background: var(--btn); border: 1px solid transparent; border-radius: var(--radiusSm); padding: 10px 14px; cursor: pointer; transition: background .15s; }
.btn:hover { background: var(--btnHover); }

/* Arbre de recherche : une section par branche, une colonne par niveau, des lignes vers les prérequis */
#research { display: flex; flex-direction: column; gap: 20px; }
.treeBranch h2 small { color: var(--accent); }
.branchBar { height: 4px; margin: 0 0 14px; background: var(--line); border-radius: 2px; overflow: hidden; }
.branchBar span { display: block; height: 100%; background: var(--accent); }
.treeScroll { overflow-x: auto; padding-bottom: 8px; }
.tree { position: relative; display: flex; gap: 46px; align-items: center; width: max-content; padding: 4px 2px; }
.treeCol { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 12px; }
.tree svg.links { position: absolute; top: 0; left: 0; z-index: 0; overflow: visible; pointer-events: none; }
.links path { fill: none; stroke-width: 1.5; }
.links path.done { stroke: var(--accent); }
.links path.open { stroke: var(--muted); }
.links path.locked { stroke: var(--line2); stroke-dasharray: 4 4; }
.node { display: flex; flex-direction: column; gap: 2px; width: 200px; padding: 12px 14px; text-align: left; background: var(--panel2); border: 1px solid var(--line); }
.node b { font-size: 14px; font-weight: 600; }
.node small { color: var(--muted2); font-size: 12px; }
.node .foot { margin-top: 6px; font-size: 12px; color: var(--muted); }
.node.owned { border-color: var(--okline); background: var(--okbg); opacity: 1; }
.node.owned .foot { color: var(--accent); }
.node.ready { border-color: var(--accent); background: var(--panel); box-shadow: 0 0 0 3px var(--ring); opacity: 1; cursor: pointer; }
.node.ready .foot { color: var(--accent); font-weight: 600; }
.node.open { opacity: .85; }
.node.locked { opacity: .45; text-align: left; padding: 12px 14px; color: inherit; border: 1px dashed var(--line2); }   /* annule la règle générale .locked */
.node.researching { border-color: var(--gold); background: var(--goldbg); opacity: 1; animation: pulse 1.8s ease-in-out infinite; }
.node.researching .foot { color: var(--gold); font-weight: 600; }
.treeLegend .node.researching { border-color: var(--gold); animation: none; }
@keyframes pulse { 50% { box-shadow: 0 0 0 4px rgba(255, 159, 10, .2); } }
/* Délai en cours (recherche, boutique du cloud, crédits cloud) */
.jobBox { box-shadow: inset 0 0 0 1px var(--gold), var(--shadow); }
.jobHead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.jobHead .mini { margin: 0; }
.jobBar { height: 6px; margin: 12px 0 8px; background: var(--line); border-radius: 3px; overflow: hidden; }
.jobBar span { display: block; height: 100%; background: var(--accent); border-radius: 3px; transition: width .5s linear; }
/* Fenêtre de confirmation intégrée (remplace les alertes du navigateur) */
.modalBack { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px;
             background: rgba(0, 0, 0, .4); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
/* Pas de fondu d'opacité : si le navigateur fige les animations (onglet en arrière-plan), la fenêtre doit rester visible */
@keyframes modalPop { from { transform: translateY(10px) scale(.97); } }
.modal { width: 100%; max-width: 440px; max-height: 90vh; overflow-y: auto; padding: 26px; background: var(--panel); border-radius: 22px;
         box-shadow: var(--shadowPop); animation: modalPop .22s cubic-bezier(.2, .8, .2, 1); }
.modal h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; font-size: 19px; font-weight: 600; letter-spacing: -.02em; color: var(--strong); }
.modalIcon { font-size: 22px; }
.modal p { margin: 0 0 8px; color: var(--text2); }
.modal ul { margin: 6px 0 12px; padding-left: 18px; color: var(--muted2); font-size: 14px; }
.modal li { margin-bottom: 4px; }
.modalInput { display: block; margin: 10px 0 4px; font-size: 14px; color: var(--muted2); }
.modalInput input { display: block; width: 100%; margin-top: 6px; }
.modalButtons { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.modalButtons button { width: auto; min-width: 110px; text-align: center; border-radius: var(--pill); }
.modal.danger .modalButtons .primary { background: var(--bad); color: #fff; }
.modalButtons .primary:disabled { opacity: .4; }

/* Processeur (page principale) */
.cpuCard { padding: 16px; margin-bottom: 10px; background: var(--panel2); border-radius: var(--radiusSm); }
.cpuStats { display: flex; flex-direction: column; gap: 4px; margin: 8px 0 12px; font-size: 13px; color: var(--muted2); }
.ocBtn { text-align: center; background: var(--panel); }
.ocBtn.on { background: var(--badbg); color: var(--badtext); }
.heatBar { height: 6px; margin: 12px 0 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.heatBar span { display: block; height: 100%; border-radius: 3px; transition: width .4s linear; }
.heatBar.cool span { background: var(--accent); }
.heatBar.warm span { background: var(--gold); }
.heatBar.hot span { background: var(--bad); }
.heatText.warm { color: var(--gold); }
.heatText.hot { color: var(--bad); }
.cpuBuy { margin-bottom: 8px; }
/* Défi de surchauffe (anti-script) : bandeau + ventilateur à toucher, placé au hasard par le serveur */
.overheat { position: sticky; top: 0; z-index: 50; padding: 12px 16px; background: var(--badbg2); color: var(--badtext); text-align: center; font-weight: 600; }
.overheatFan { position: fixed; z-index: 60; width: 64px; height: 64px; margin: -32px 0 0 -32px; padding: 0; font-size: 32px; text-align: center; border: 0; border-radius: 50%;
               background: var(--panel); box-shadow: var(--shadowPop), 0 0 0 4px var(--ring); cursor: pointer; animation: spin 2s linear infinite; }
.overheatFan:hover:not(:disabled) { background: var(--panel); box-shadow: var(--shadowPop), 0 0 0 6px var(--ring); }
@keyframes spin { to { transform: rotate(360deg); } }
.treeScroll { scrollbar-color: var(--line2) transparent; scrollbar-width: thin; }
.treeLegend { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; }
.treeLegend .node { width: auto; padding: 4px 12px; font-size: 12px; border-radius: var(--pill); cursor: default; box-shadow: none; }
.treeLegend .node.owned { border-color: var(--okline); }
.treeLegend .node.ready { border-color: var(--accent); }
.treeLegend .node.locked { border-style: dashed; }

/* Barre du haut : bandeau « verre dépoli » collé en haut, liens discrets */
.topbar { position: sticky; top: 0; z-index: 30; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 8px;
          min-height: 52px; padding: 6px max(20px, calc((100vw - 1840px) / 2 + 20px)); background: var(--glass); border-bottom: 1px solid var(--line);
          -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); }
.topbar h1 { flex: 0 0 auto; margin: 0; padding: 0 0 0 14px; border: 0; border-left: 1px solid var(--line2); font-size: 15px; font-weight: 500; color: var(--muted2); letter-spacing: -.01em; }
/* Menu aligné à droite, sur la même ligne que le titre quand il y a la place (sinon il passe dessous, toujours calé à droite) */
#nav { flex: 1 1 auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 2px; margin-left: auto; }
.topbar .btn { display: inline-block; width: auto; margin: 0; padding: 7px 11px; font-size: 14px; white-space: nowrap; color: var(--text2); text-decoration: none; background: transparent; border-radius: 8px; }
.topbar .btn:hover { color: var(--strong); background: var(--btn); }
#nav #userName { margin: 0 2px 0 10px; padding-left: 12px; border-left: 1px solid var(--line2); white-space: nowrap; font-size: 13px; }
#nav .status { white-space: nowrap; }
/* Écrans moyens : tout tient sur UNE ligne (logo, Crise de la RAM, menu). Le titre de la page se cache, puis les boutons se resserrent.
   Plus étroit encore (< 1260 px), le menu passe de toute façon sur une 2e ligne : le titre revient à côté du logo.
   Sous 1000 px, « ● Connecté » (l'état normal) se cache pour que le menu tienne ; « Hors ligne » / « Pas à jour » restent affichés. */
@media (max-width: 1560px) and (min-width: 1261px) { .topbar h1 { display: none; } }
@media (max-width: 1000px) { #nav .status.ok { display: none; } }
@media (max-width: 1360px) { .topbar .btn { padding: 7px 8px; font-size: 13.5px; } #nav #userName { margin-left: 6px; padding-left: 8px; } }
/* Téléphone : la barre ne reste pas collée en haut (elle prendrait trop de place) et le menu tient sur une ligne qu'on fait défiler */
@media (max-width: 700px) {
  .topbar { position: static; padding: 8px 12px 4px; }
  .topbar h1 { display: none; }
  #nav { flex: 1 1 100%; flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; margin: 0 -12px; padding: 0 12px 4px; }
  #nav::-webkit-scrollbar { display: none; }
  #nav #userName { margin-left: 4px; }
}
.navBadge { display: inline-block; min-width: 18px; margin-left: 6px; padding: 0 6px; border-radius: var(--pill); background: var(--accent); color: var(--onAccent); font-size: 11px; font-weight: 600; line-height: 18px; text-align: center; vertical-align: 1px; }
.navBadge.busy { background: var(--btn); color: var(--muted2); letter-spacing: 1px; }
.status { font-size: 12px; }
.status.ok { color: #1d8a3a; }
.status.bad { padding: 3px 9px; border-radius: 999px; background: var(--badbg); color: var(--badtext); font-weight: 600; cursor: help; }
:root[data-theme="dark"] .status.ok { color: #30d158; }
main.single { display: block; }
main.single section { margin-bottom: 20px; }
/* Titre de page en grand, au-dessus du contenu (pages à une colonne) */
main.single > section:first-child { padding-top: 28px; }

/* Connexion */
body.login { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding-bottom: 0; }
.card { width: 420px; max-width: 94vw; background: var(--panel); border-radius: 24px; padding: 32px 28px; box-shadow: var(--shadowPop); }
.card h1 { border: 0; padding: 0 0 18px; text-align: center; }
.tabs { display: flex; gap: 2px; margin-bottom: 20px; padding: 3px; background: var(--btn); border-radius: var(--radiusSm); }
.tab { text-align: center; background: transparent; border-radius: 9px; padding: 8px; }
.tab.on { background: var(--panel); color: var(--strong); font-weight: 600; box-shadow: 0 1px 4px rgba(0, 0, 0, .12); }
form label { display: block; margin-bottom: 14px; color: var(--muted2); font-size: 14px; }
input, select, textarea { display: block; width: 100%; margin-top: 6px; padding: 11px 14px; font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--line2); border-radius: var(--radiusSm);
        transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--ring); }
.error { min-height: 20px; margin-bottom: 8px; color: var(--bad); font-size: 14px; }
form button[type=submit] { padding: 12px; }

/* Menu, classement, succès */
a.btn { color: inherit; text-decoration: none; }
#userName { margin: 0 10px; color: var(--muted2); }
.lb { display: grid; grid-template-columns: 28px 1fr auto; gap: 8px; padding: 8px 12px; border-radius: 10px; margin-bottom: 4px; background: var(--panel2); font-variant-numeric: tabular-nums; }
.lb.me { background: var(--okbg); color: var(--accent); font-weight: 600; }
.locked { padding: 18px; text-align: center; color: var(--muted2); background: var(--panel2); border-radius: var(--radiusSm); }
.achGrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }

/* L'attribut hidden doit toujours gagner, même contre un display: block */
[hidden] { display: none !important; }

/* Patch notes : lien fixe en bas à gauche + page */
body { padding-bottom: 64px; }
.patchlink { position: fixed; left: 16px; bottom: 16px; z-index: 20; padding: 8px 14px; color: var(--text); text-decoration: none; font-size: 13px;
             background: var(--glass); border: 1px solid var(--line); border-radius: var(--pill); box-shadow: var(--shadow);
             -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); }
.patchlink:hover { border-color: var(--line2); }
.newdot { display: inline-block; padding: 1px 8px; border-radius: var(--pill); background: var(--accent); color: var(--onAccent); font-size: 11px; font-weight: 600; }
.patch ul { margin: 10px 0 0; padding-left: 0; list-style: none; }
.patch li { margin-bottom: 10px; }
.tag { display: inline-block; margin-right: 8px; padding: 2px 10px; border-radius: var(--pill); font-size: 12px; font-weight: 500; background: var(--btn); }
.tag.new { color: var(--bluetext); background: var(--bluebg); }
.tag.roleAdmin { color: var(--bluetext); background: var(--bluebg); }
.tag.roleSuper { color: var(--gold); background: var(--goldbg); font-weight: 600; }   /* panneau admin : rôle du compte */
.tag.balance { color: var(--warn); background: var(--warnbg); }
.tag.fix { color: #1d8a3a; background: #eaf7ee; }
:root[data-theme="dark"] .tag.fix { color: #30d158; background: #0c2614; }

/* Statistiques */
.statGrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.stat { padding: 16px; background: var(--panel2); border-radius: var(--radiusSm); }
.stat small { display: block; margin-bottom: 2px; }
.stat b { font-size: 22px; font-weight: 600; letter-spacing: -.02em; color: var(--strong); font-variant-numeric: tabular-nums; }
.controls { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.controls button { width: auto; text-align: center; border-radius: var(--pill); padding: 7px 14px; font-size: 14px; }
.controls .on { background: var(--strong); color: var(--panel); }
.chartTitle { margin: 16px 0 6px; font-size: 13px; color: var(--muted2); }
.chart { width: 100%; height: auto; }
.bar { display: grid; grid-template-columns: 170px 1fr 170px; gap: 10px; align-items: center; margin-bottom: 8px; font-size: 13px; }
.track { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.fill { height: 100%; background: var(--accent); border-radius: 3px; }
@media (max-width: 700px) { .bar { grid-template-columns: 1fr; gap: 2px; } }

/* Administration + annonce */
.announce { padding: 10px 16px; text-align: center; background: var(--accent); color: var(--onAccent); font-weight: 500; font-size: 14px; }
.adminForm { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.adminForm.spaced { margin-top: 10px; }
.adminForm input, .adminForm select { width: auto; flex: 1 1 200px; margin: 0; }
.adminForm input[type=number] { flex: 0 0 90px; }
.adminForm button { width: auto; text-align: center; }
.tableWrap { overflow-x: auto; }
.givePreview { flex: 1 1 200px; align-self: center; color: var(--muted2); }
.givePreview.bad { color: var(--bad); }
#players { width: 100%; border-collapse: collapse; font-size: 13px; }
#players th, #players td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
#players th { color: var(--muted2); font-weight: 500; }
.mini { display: inline-block; width: auto; padding: 4px 8px; margin-right: 3px; border-radius: 8px; }
.mini.danger:hover:not(:disabled) { background: var(--badbg); color: var(--badtext); }
.secretBox { padding: 14px; margin-bottom: 12px; border-radius: var(--radiusSm); background: var(--okbg); }
code { padding: 2px 6px; background: var(--btn); border-radius: 6px; color: var(--strong); font: 14px ui-monospace, "SF Mono", Menlo, Consolas, monospace; user-select: all; }
.auditRow { padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13px; }

/* Classement et prestige */
.lbTable { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.lbTable th, .lbTable td { padding: 12px 10px; text-align: left; border-bottom: 1px solid var(--line); }
.lbTable th { color: var(--muted2); font-weight: 500; font-size: 13px; }
.lbTable tr.me { background: var(--okbg2); color: var(--accent); font-weight: 600; }
.lbTable .gap { text-align: center; color: var(--muted); }
.rankTitle { display: block; font-size: 12px; color: var(--muted2); font-weight: 400; }
.rankBox { font-size: 28px; font-weight: 600; letter-spacing: -.02em; color: var(--strong); }
.perk { display: grid; grid-template-columns: 1fr 120px; gap: 12px; align-items: center; margin-bottom: 10px; padding: 16px; background: var(--panel2); border: 1px solid transparent; border-radius: var(--radiusSm); }
.perk button { text-align: center; background: var(--panel); }
.perk.owned { border-color: var(--okline); }
.perk.deploying { border-color: var(--gold); }
.perk.respec { margin-top: 16px; border: 1px dashed var(--line2); }
.perkCat { margin: 20px 0 10px; font-size: 13px; font-weight: 600; color: var(--muted2); }
.perkCat:first-child { margin-top: 0; }
.ccBuy { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0; }
.ccBuy .mini { margin: 0; min-width: 44px; text-align: center; }
.ccWanted { min-width: 80px; text-align: center; font-size: 20px; font-weight: 600; color: var(--strong); }
.ccBar { height: 6px; margin: 8px 0; background: var(--line); border-radius: 3px; overflow: hidden; }
.ccBar span { display: block; height: 100%; background: var(--accent); border-radius: 3px; transition: width .4s; }
#rebootBox button, #migrationBox button { width: auto; text-align: center; }

/* Guide : lecture confortable */
.guide section { line-height: 1.65; }
.guide h3 { margin: 24px 0 8px; font-size: 17px; font-weight: 600; color: var(--strong); }
.guide ul, .guide ol { padding-left: 22px; }
.guide li { margin-bottom: 8px; }
.toc { display: flex; flex-wrap: wrap; gap: 6px; }
.toc .btn { display: inline-block; width: auto; padding: 6px 14px; font-size: 13px; border-radius: var(--pill); }
.tip, .warn { margin: 14px 0; padding: 14px 18px; border-radius: var(--radiusSm); background: var(--okbg2); }
.warn { background: var(--warnbg); }
.guide details { margin: 10px 0; padding: 12px 16px; background: var(--panel2); border-radius: var(--radiusSm); }
.guide summary { cursor: pointer; color: var(--accent); font-weight: 500; }
.guide details p { margin: 8px 0 0; }
html { scroll-behavior: smooth; }

/* ---------- Skins de la barrette (débloqués par les succès, choisis sur la page Succès) ---------- */
:root { --pcb: linear-gradient(180deg, #16934f 0%, #0d6e3f 55%, #0a5a33 100%); --pcbEdge: #3ddc84; --pcbGlow: #7dffb5;
                   --chipC: linear-gradient(160deg, #343b44 0%, #161b21 45%, #0c0f13 100%); }
[data-skin="carbon"]  { --pcb: repeating-linear-gradient(45deg, #1d1f22 0 6px, #2a2d31 6px 12px); --pcbEdge: #7c8590; --pcbGlow: #c9d1da; }
[data-skin="gold"]    { --pcb: linear-gradient(180deg, #f3cf5c 0%, #c9971f 55%, #8f6610 100%); --pcbEdge: #ffe9a3; --pcbGlow: #fff4c8;
                        --chipC: linear-gradient(160deg, #5a3f06 0%, #2e2003 60%, #1a1202 100%); }
[data-skin="ice"]     { --pcb: linear-gradient(180deg, #bfe9ff 0%, #6cc2ea 55%, #2f86b8 100%); --pcbEdge: #e6f8ff; --pcbGlow: #ffffff;
                        --chipC: linear-gradient(160deg, #3d6f8c 0%, #1d4660 60%, #0f2c3e 100%); }
[data-skin="rgb"]     { --pcb: linear-gradient(90deg, #ff3b6b, #ffb13b, #4cff7a, #3bc8ff, #a35bff, #ff3b6b); --pcbEdge: #ffffff; --pcbGlow: #ffffff; }
[data-skin="plasma"]  { --pcb: linear-gradient(90deg, #2a0b4d, #8f2bd8, #ff7bd5, #ffd0f2, #ff7bd5, #8f2bd8, #2a0b4d); --pcbEdge: #ff9be3; --pcbGlow: #ffd0f2;
                        --chipC: linear-gradient(160deg, #3b1450 0%, #1c0828 60%, #0e0414 100%); }
[data-skin="quantum"] { --pcb: linear-gradient(90deg, #0a0f3a, #2251b8, #6cf3ff, #e2fdff, #6cf3ff, #2251b8, #0a0f3a); --pcbEdge: #9ff6ff; --pcbGlow: #e2fdff;
                        --chipC: linear-gradient(160deg, #1b2a6b 0%, #0d1540 60%, #060a22 100%); }
/* Skins à acheter avec de la RAM (G.SKIN_SHOP) */
[data-skin="neon"]    { --pcb: linear-gradient(180deg, #120a24 0%, #0b0716 100%); --pcbEdge: #ff2bd6; --pcbGlow: #39ff14;
                        --chipC: linear-gradient(160deg, #1d3b1a 0%, #0c1f0a 60%, #061005 100%); }
[data-skin="neon"]#chip, .miniChip[data-skin="neon"] { box-shadow: 0 0 14px rgba(255, 43, 214, .55), inset 0 0 10px rgba(57, 255, 20, .25); }
[data-skin="camo"]    { --pcb: radial-gradient(circle at 18% 30%, #56683f 0 16%, transparent 17%), radial-gradient(circle at 62% 70%, #2c3822 0 20%, transparent 21%),
                               radial-gradient(circle at 85% 25%, #6b6a45 0 14%, transparent 15%), radial-gradient(circle at 38% 90%, #56683f 0 13%, transparent 14%), #3e4a2e;
                        --pcbEdge: #9aa77a; --pcbGlow: #c9d3a5; --chipC: linear-gradient(160deg, #2e3324 0%, #191c13 60%, #0e100a 100%); }
[data-skin="ruby"]    { --pcb: linear-gradient(180deg, #ff5a7a 0%, #c0123c 55%, #6d0620 100%); --pcbEdge: #ffb3c4; --pcbGlow: #ffe1e8;
                        --chipC: linear-gradient(160deg, #4a0716 0%, #26030b 60%, #140106 100%); }
[data-skin="galaxy"]  { --pcb: radial-gradient(circle at 12% 25%, #fff 0 1px, transparent 2px), radial-gradient(circle at 40% 70%, #fff 0 1px, transparent 2px),
                               radial-gradient(circle at 72% 30%, #ffe9a3 0 1.5px, transparent 2.5px), radial-gradient(circle at 88% 78%, #fff 0 1px, transparent 2px),
                               radial-gradient(ellipse at 60% 40%, rgba(163, 91, 255, .7) 0%, transparent 60%), linear-gradient(180deg, #160a3d 0%, #070320 100%);
                        --pcbEdge: #c9a8ff; --pcbGlow: #f0e6ff; --chipC: linear-gradient(160deg, #241552 0%, #110a2c 60%, #080416 100%); }
[data-skin="aurora"]  { --pcb: linear-gradient(90deg, #0f3d3e, #1de9b6, #00b0ff, #7c4dff, #00b0ff, #1de9b6, #0f3d3e); --pcbEdge: #a7ffeb; --pcbGlow: #e0fff8;
                        --chipC: linear-gradient(160deg, #123c45 0%, #0a2228 60%, #051216 100%); }
/* Skin unique, offert seulement par un administrateur (G.SKIN_EXCLUSIVE) */
[data-skin="legend"]  { --pcb: linear-gradient(90deg, #1a1405, #8f6610, #f5d76e, #fff8dc, #f5d76e, #8f6610, #1a1405); --pcbEdge: #fff4c8; --pcbGlow: #ffffff;
                        --chipC: linear-gradient(160deg, #0d0d0d 0%, #000 100%); }
[data-skin="legend"]#chip, .miniChip[data-skin="legend"] { box-shadow: 0 0 18px rgba(245, 215, 110, .65); }
/* Skin unique « Survivant » : métal brut usé, traces de rouille et de brûlure, une ligne rouge vif qui « respire » */
[data-skin="survivor"] { --pcb: radial-gradient(ellipse at 18% 70%, rgba(150, 70, 20, .75) 0 14%, transparent 30%), radial-gradient(ellipse at 78% 22%, rgba(120, 55, 15, .6) 0 10%, transparent 26%),
                               radial-gradient(circle at 55% 85%, rgba(0, 0, 0, .55) 0 8%, transparent 20%), repeating-linear-gradient(115deg, rgba(255, 255, 255, .05) 0 1px, transparent 1px 7px),
                               linear-gradient(180deg, #4a4d50 0%, #2c2e30 55%, #1b1c1d 100%);
                        --pcbEdge: #d13a1f; --pcbGlow: #ff6a3d; --chipC: linear-gradient(160deg, #3a2a22 0%, #1d1512 60%, #0e0a08 100%); }
:is(#chip, .miniChip)[data-skin="survivor"] { animation: survivorPulse 2.6s ease-in-out infinite; }
@keyframes survivorPulse { 0%, 100% { border-color: #8f2412; } 50% { border-color: #ff5a2e; } }
/* Skin unique « Survivant doré » (v60) : le Survivant, mais en or massif usé ; traces sombres, reflets, liseré doré qui « respire » */
[data-skin="goldsurvivor"] { --pcb: radial-gradient(ellipse at 18% 70%, rgba(90, 55, 5, .7) 0 14%, transparent 30%), radial-gradient(ellipse at 78% 22%, rgba(70, 40, 0, .55) 0 10%, transparent 26%),
                                   radial-gradient(circle at 55% 85%, rgba(0, 0, 0, .45) 0 8%, transparent 20%), repeating-linear-gradient(115deg, rgba(255, 255, 255, .09) 0 1px, transparent 1px 7px),
                                   linear-gradient(180deg, #f1cd5a 0%, #c08f1c 55%, #7a5508 100%);
                            --pcbEdge: #ffd75e; --pcbGlow: #fff1b8; --chipC: linear-gradient(160deg, #2b2006 0%, #171103 60%, #0b0801 100%); }
:is(#chip, .miniChip)[data-skin="goldsurvivor"] { animation: goldSurvivorPulse 2.6s ease-in-out infinite; }
#chip[data-skin="goldsurvivor"], .miniChip[data-skin="goldsurvivor"] { box-shadow: 0 0 16px rgba(255, 205, 80, .5); }
@keyframes goldSurvivorPulse { 0%, 100% { border-color: #9a6f0c; } 50% { border-color: #ffe27a; } }
/* Skin unique « Claude » (v60) : terre cuite chaude et crème, puces sombres, lueur orangée douce */
[data-skin="claude"] { --pcb: radial-gradient(circle at 50% 50%, rgba(255, 240, 225, .22) 0 18%, transparent 45%), linear-gradient(180deg, #e08a68 0%, #d97757 45%, #b4532f 100%);
                       --pcbEdge: #f5efe6; --pcbGlow: #fff6ec; --chipC: linear-gradient(160deg, #2d2621 0%, #1c1714 60%, #110d0b 100%); }
#chip[data-skin="claude"], .miniChip[data-skin="claude"] { box-shadow: 0 0 16px rgba(217, 119, 87, .55); }
/* Logo sur la puce du milieu : une étoile à 12 rayons couleur corail (dessinée en CSS : la CSP du site bloque les images « data: »).
   Les rayons sont des parts de « camembert » (repeating-conic-gradient), coupées en cercle par un calque de la couleur de la puce. */
[data-skin="claude"] { --claudeRay: #e8875f; --claudeChip: #1f1915; }
#chip[data-skin="claude"] span:nth-child(3) {
  background: radial-gradient(circle at 50% 55%, var(--claudeRay) 0 3px, transparent 3.5px), radial-gradient(circle at 50% 55%, transparent 0 14px, var(--claudeChip) 14.5px),
              repeating-conic-gradient(from 7deg at 50% 55%, var(--claudeRay) 0 14deg, transparent 14deg 30deg), var(--claudeChip); }
#chip[data-skin="claude"] span:nth-child(3)::after { display: none; }
.miniChip[data-skin="claude"] span:nth-child(3) {
  background: radial-gradient(circle at 50% 52%, var(--claudeRay) 0 1.2px, transparent 1.6px), radial-gradient(circle at 50% 52%, transparent 0 6px, var(--claudeChip) 6.5px),
              repeating-conic-gradient(from 7deg at 50% 52%, var(--claudeRay) 0 14deg, transparent 14deg 30deg), var(--claudeChip); }
/* Skin unique « Gabbai - Glitched » (v65, donné seulement par un super admin) : barrette « buggée ». Fond presque noir traversé de
   bandes magenta / cyan décalées, lignes de balayage d'écran, contour rouge / cyan décalé (aberration chromatique) ; de temps en temps,
   les puces « sautent » de quelques pixels et le contour clignote. On anime les PUCES et le contour, jamais la barrette elle-même :
   son « transform » sert déjà au survol et au clic. */
[data-skin="gabbai"] { --pcb: linear-gradient(180deg, transparent 0 18%, rgba(255, 42, 109, .55) 18% 21%, transparent 21% 47%, rgba(0, 240, 255, .5) 47% 49%,
                                transparent 49% 71%, rgba(255, 42, 109, .35) 71% 72.5%, transparent 72.5%),
                              linear-gradient(90deg, transparent 0 63%, rgba(0, 240, 255, .18) 63% 81%, transparent 81%),
                              repeating-linear-gradient(0deg, rgba(255, 255, 255, .05) 0 1px, transparent 1px 3px),
                              linear-gradient(180deg, #16121f 0%, #0b0a12 60%, #06050a 100%);
                       --pcbEdge: #00f0ff; --pcbGlow: #ff2a6d; --chipC: linear-gradient(160deg, #2a2335 0%, #120f18 60%, #08060c 100%); }
#chip[data-skin="gabbai"], .miniChip[data-skin="gabbai"] { box-shadow: -3px 0 0 rgba(255, 42, 109, .7), 3px 0 0 rgba(0, 240, 255, .7), 0 0 18px rgba(0, 240, 255, .3); }
:is(#chip, .miniChip)[data-skin="gabbai"] { animation: glitchEdge 3.2s steps(1, end) infinite; }
:is(#chip, .miniChip)[data-skin="gabbai"] span { box-shadow: -2px 0 0 rgba(255, 42, 109, .55), 2px 0 0 rgba(0, 240, 255, .55); animation: glitchSlice 3.2s steps(1, end) infinite; }
:is(#chip, .miniChip)[data-skin="gabbai"] span:nth-child(2) { animation-delay: -.4s; }
:is(#chip, .miniChip)[data-skin="gabbai"] span:nth-child(3) { animation-delay: -1.1s; }
:is(#chip, .miniChip)[data-skin="gabbai"] span:nth-child(4) { animation-delay: -1.7s; }
:is(#chip, .miniChip)[data-skin="gabbai"] span:nth-child(5) { animation-delay: -2.3s; }
#chip[data-skin="gabbai"] b { color: #e8fbff; text-shadow: -1px 0 #ff2a6d, 1px 0 #00f0ff; }
@keyframes glitchEdge { 0%, 86%, 92%, 100% { border-color: #00f0ff; } 87% { border-color: #ff2a6d; } 89% { border-color: #ffffff; } 90% { border-color: #ff2a6d; } }
@keyframes glitchSlice { 0%, 87%, 93%, 100% { transform: none; } 88% { transform: translateX(-3px); } 90% { transform: translate(3px, -1px); } 91.5% { transform: translateX(-1px) skewX(-6deg); } }
@media (prefers-reduced-motion: reduce) { :is(#chip, .miniChip)[data-skin="gabbai"] span { animation: none; } }
/* Skins animés : le dégradé défile en boucle (la fin du dégradé = son début, d'où une boucle sans à-coup) */
:is(#chip, .miniChip):is([data-skin="rgb"], [data-skin="plasma"], [data-skin="quantum"], [data-skin="aurora"], [data-skin="legend"]) {
  background-size: 300% 100%; animation: rgbFlow 4s linear infinite; }
:is(#chip, .miniChip)[data-skin="plasma"]  { animation-duration: 5s; }
:is(#chip, .miniChip)[data-skin="quantum"] { animation-duration: 9s; animation-direction: reverse; }   /* lent : 3 s était trop rapide */
:is(#chip, .miniChip)[data-skin="aurora"]  { animation-duration: 7s; }
:is(#chip, .miniChip)[data-skin="legend"]  { animation-duration: 3.5s; }
@keyframes rgbFlow { to { background-position: 300% 0; } }
@media (prefers-reduced-motion: reduce) { :is(#chip, .miniChip)[data-skin] { animation: none; } }
.skinGrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.skinTile { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 16px 10px; text-align: center; }
.skinTile.on { border-color: var(--accent); background: var(--okbg); }
.skinTile:disabled { opacity: .55; cursor: default; }
.skinTile.on:disabled { opacity: 1; }
.skinTile.shop:disabled { opacity: .7; }
.skinHead { grid-column: 1 / -1; margin: 18px 0 2px; font-size: 17px; font-weight: 600; color: var(--strong); }
.miniChip { position: relative; display: flex; justify-content: center; gap: 4px; width: 110px; height: 44px; padding: 7px 6px 0; margin-bottom: 4px;
            background: var(--pcb); border: 1px solid var(--pcbEdge); border-radius: 5px 5px 2px 2px; }
.miniChip span { width: 15px; height: 17px; border-radius: 2px; background: var(--chipC); }
.miniChip::after { content: ''; position: absolute; left: 5px; right: 5px; bottom: 0; height: 6px;
                   background: repeating-linear-gradient(90deg, #f0c650 0 2px, #b8892a 2px 3px, transparent 3px 5px); }

/* ---------- Événement temporaire (bandeau en haut, pour tous les joueurs) ---------- */
.eventBanner { padding: 10px 16px; text-align: center; background: var(--panel); border-bottom: 1px solid var(--line); color: var(--text); font-size: 14px; }
.eventBanner b { color: var(--strong); font-weight: 600; }
.eventBar { max-width: 420px; height: 4px; margin: 8px auto 6px; border-radius: 2px; background: var(--line); overflow: hidden; }
.eventBar i { display: block; height: 100%; background: var(--accent); border-radius: 2px; transition: width .4s; }

/* ---------- Journal de partie (Statistiques) ---------- */
.journal { max-height: 420px; overflow-y: auto; }
.jRow { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.jRow small { color: var(--muted); white-space: nowrap; }
.jIcon { text-align: center; }

/* Compteur de clics par seconde (mesuré par le serveur), en haut à gauche du panneau de la barrette */
.cpsBadge { display: block; width: fit-content; margin: 0 0 4px; padding: 3px 10px; border-radius: var(--pill); font-size: 12px; color: var(--muted2); background: var(--panel2); font-variant-numeric: tabular-nums; }

/* ---------- Réglages (⚙) ---------- */
.settingRow { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.settingRow small { display: block; color: var(--muted); }
.switch { min-width: 120px; text-align: center; border-radius: var(--pill); }
.switch.on { background: var(--accent); color: var(--onAccent); font-weight: 500; }
.switch.on:hover:not(:disabled) { background: var(--accentHover); }

/* ---------- Icônes au trait (v44 : remplacent les emojis) ---------- */
.ico { width: 1em; height: 1em; vertical-align: -.125em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.kcCharm .ico { width: 18px; height: 18px; color: var(--strong); }
.keyTile .kcCharm .ico { width: 20px; height: 20px; }
.keyTile:disabled .kcCharm .ico { color: var(--muted); }
.rowLink span .ico { width: 12px; height: 12px; color: var(--gold); }
.tierBadge .ico { width: 11px; height: 11px; margin-right: 1px; }
.overheatFan .ico { width: 34px; height: 34px; color: var(--accent); stroke-width: 1.6; }
/* Classement : pastilles or, argent, bronze pour les 3 premiers */
.medal { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-size: 12px; font-weight: 600; color: #fff; }
.medal.m1 { background: #d4a72c; } .medal.m2 { background: #a1a1a6; } .medal.m3 { background: #b87333; }
/* Panneau admin : joueur en ligne, nombre de clics refusés élevé */
.onlineDot { display: inline-block; width: 8px; height: 8px; margin-left: 4px; border-radius: 50%; background: #34c759; vertical-align: 1px; }
.warnText { color: var(--warn); }
/* Journal de partie : une pastille à la place de l'icône */
.jIcon::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
/* Quêtes du jour : case ronde (vide, puis cochée quand la quête est faite) */
.quest > b { position: relative; display: flex; align-items: center; gap: 10px; }
.quest > b::before { content: ''; flex: 0 0 auto; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--line2); box-sizing: border-box; }
.quest.done > b::before, .quest.claimed > b::before { border-color: var(--accent); background: var(--accent); }
/* coche dessinée en CSS (les images data: sont bloquées par la politique de sécurité du site) */
.quest.done > b::after, .quest.claimed > b::after { content: ''; position: absolute; left: 6px; top: 50%; width: 4px; height: 8px; margin-top: -6px;
  border: solid var(--onAccent); border-width: 0 2px 2px 0; transform: rotate(45deg); }

/* ---------- Bouton « Redémarrer » (v49) : il se remplit vers le prochain point BIOS ---------- */
/* --p = part faite vers le prochain BIOS (mise à jour par common.js). Sélecteurs par id : ils passent devant les règles #reboot plus haut. */
:is(#reboot, #prestigeReboot) { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 100%; margin-top: 18px; padding: 10px 18px;
  text-align: center; border-radius: var(--pill); color: var(--onAccent); transition: transform .1s;
  background: linear-gradient(90deg, rgba(255, 255, 255, .24) var(--p, 0%), transparent var(--p, 0%)), var(--accent); }
:is(#reboot, #prestigeReboot):hover:not(:disabled) { background: linear-gradient(90deg, rgba(255, 255, 255, .24) var(--p, 0%), transparent var(--p, 0%)), var(--accentHover); }
:root[data-theme="dark"] :is(#reboot, #prestigeReboot) { background: linear-gradient(90deg, rgba(0, 0, 0, .18) var(--p, 0%), transparent var(--p, 0%)), var(--accent); }
/* Pas encore de BIOS à gagner : bouton gris, rempli en vert pâle au fur et à mesure */
:is(#reboot, #prestigeReboot):disabled { opacity: 1; color: var(--text2); cursor: not-allowed;
  background: linear-gradient(90deg, var(--okline) var(--p, 0%), transparent var(--p, 0%)), var(--btn); }
#prestigeReboot { max-width: 420px; }
.rbMain { font-weight: 600; }
.rbSub { font-size: 12px; opacity: .85; font-variant-numeric: tabular-nums; }

/* ---------- Jeux : pierre, feuille, ciseaux (v51) ---------- */
.rpsMoney { margin: 14px 0 10px; font-size: 17px; }
.rpsMoney b { font-variant-numeric: tabular-nums; }
.rpsBet { align-items: flex-end; }
.rpsBet label { flex: 0 1 240px; margin: 0; color: var(--muted2); font-size: 14px; }
.rpsBet button { border-radius: var(--pill); }
.rpsHint { min-height: 22px; margin: 4px 0 14px; }
.rpsHint.bad small { color: var(--bad); }
.rpsChoices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; max-width: 640px; }
.rpsChoice { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 10px; text-align: center; font-weight: 600; border-radius: var(--radius); }
.rpsChoice .ico { width: 40px; height: 40px; stroke-width: 1.5; color: var(--strong); }
.rpsChoice:hover:not(:disabled) { border-color: var(--accent); }
.rpsResult { max-width: 640px; margin-top: 18px; padding: 0; border-radius: var(--radius); }
.rpsResult:not(:empty) { padding: 18px; background: var(--panel2); }
.rpsResult.win { background: var(--okbg); }
.rpsResult.lose { background: var(--badbg); }
.rpsDuel { display: flex; align-items: center; justify-content: center; gap: 28px; text-align: center; }
.rpsDuel > div { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.rpsHand .ico { width: 46px; height: 46px; stroke-width: 1.4; color: var(--strong); }
.rpsVs { color: var(--muted2); font-weight: 500; }
.rpsOutcome { margin: 14px 0 0; text-align: center; font-size: 22px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.rpsResult.win .rpsOutcome { color: var(--accent); }
.rpsResult.lose .rpsOutcome { color: var(--bad); }
/* Défis entre joueurs (v52) */
.duelMoves { margin-top: 12px; }
.duelRow > b, .duelRow > small { display: block; }   /* titre et lignes du défi ; les montants en gras restent dans la phrase */
.duelAnswer { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.duelAnswer .mini { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--pill); background: var(--panel); }
.duelAnswer .ico { width: 16px; height: 16px; }
.duel-win b { color: var(--accent); }
.duel-lose b { color: var(--bad); }
/* Taxe sur les gains et dépôt commun (v54) */
.rpsTaxPool { margin: -4px 0 12px; }
.rpsTaxLine { margin: 6px 0 0; text-align: center; }
/* Mot de passe temporaire (panneau admin) : grand, lisible, facile à sélectionner */
.secretCode { margin: 10px 0 14px; text-align: center; }
.secretCode code { display: inline-block; padding: 10px 18px; font-size: 24px; letter-spacing: .08em; -webkit-user-select: all; user-select: all; }

/* Profil (v55) : formulaires, case « Rester connecté », pseudo cliquable dans le menu */
.profileForm { max-width: 420px; }
.profileForm button[type=submit] { width: auto; padding: 11px 22px; }
form label.checkRow { display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 10px; color: var(--text); cursor: pointer; }
form label.checkRow input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
form label.checkRow small { grid-column: 2; color: var(--muted); font-size: 12px; }
a.userLink { color: var(--muted2); text-decoration: none; border-bottom: 1px dashed transparent; }
a.userLink:hover { color: var(--accent); border-bottom-color: currentColor; }

/* Jauge de chaleur sous la RAM (v56) : visible seulement près de la limite de vitesse de clic */
.heat { width: 280px; max-width: 100%; margin: -6px auto 18px; text-align: center; }
.heatBar { height: 8px; border-radius: 4px; background: var(--btn); overflow: hidden; }
.heatBar i { display: block; height: 100%; width: 0; border-radius: 4px; background: linear-gradient(90deg, #ff9f0a, #ff3b30); transition: width .3s; }
.heat small { display: block; margin-top: 6px; color: var(--bad); font-size: 12px; }
.heat.max .heatBar i { animation: heatPulse 1s ease-in-out infinite; }
@keyframes heatPulse { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .heat.max .heatBar i { animation: none; } }

/* Page « Crise de la RAM » (v58) : compteur du prix réel de la RAM */
.priceHero { margin: 22px 0 12px; padding: 22px; text-align: center; background: var(--panel2); border-radius: var(--radius); }
.priceBig { margin: 6px 0; font-size: clamp(44px, 9vw, 76px); font-weight: 700; line-height: 1.05; letter-spacing: -.03em; font-variant-numeric: tabular-nums; color: var(--strong); }
.priceSub { color: var(--text2); font-size: 15px; }
.priceSub .up { color: var(--badtext); }
.priceTicker { margin: 0 0 16px; padding: 12px 16px; text-align: center; border: 1px dashed var(--line2); border-radius: var(--radiusSm); }
.priceTicker .tickNum { font-variant-numeric: tabular-nums; color: var(--badtext); }
.crise .statGrid .stat b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; }
.priceStatus { margin: 12px 0 0; }
.priceChart { position: relative; }
.priceChart svg { display: block; width: 100%; height: auto; touch-action: pan-y; }
.priceChart .grid { stroke: var(--line); }
.statChart .grid { stroke: var(--line); }
.statChart .axis { fill: var(--muted); font-size: 11px; }
.statChart .line { fill: none; stroke: var(--accent); stroke-width: 2; }   /* couleurs du graphique de la page Statistiques (plus de style dans le HTML : CSP) */
.priceChart .axis { fill: var(--muted); font-size: 11px; }
.priceChart .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.priceChart .area { fill: var(--accent); opacity: .1; }
.priceChart .cross { stroke: var(--line2); stroke-width: 1; }
.priceChart .dot { fill: var(--accent); stroke: var(--panel); stroke-width: 2; }
.priceChart .hit { fill: transparent; cursor: crosshair; }
.chartTip { position: absolute; transform: translate(-50%, -100%); padding: 8px 10px; font-size: 13px; line-height: 1.4; white-space: nowrap; pointer-events: none;
            background: var(--panel); color: var(--text); border: 1px solid var(--line2); border-radius: 8px; box-shadow: var(--shadowPop); }
.crise .sources a { word-break: break-word; }
/* Lien « Crise de la RAM » à gauche de la barre du haut, collé au logo : à part des pages du jeu (v58) */
.criseLink { display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto; padding: 5px 12px; font-size: 13px; font-weight: 600; white-space: nowrap;
             color: var(--badtext); text-decoration: none; background: var(--badbg); border: 1px solid transparent; border-radius: 999px; transition: border-color .15s; }
.criseLink:hover { border-color: var(--badtext); }
.criseLink.on { border-color: var(--badtext); }
.criseLink i { width: 7px; height: 7px; border-radius: 50%; background: var(--bad); animation: crisePulse 1.6s ease-in-out infinite; }
@keyframes crisePulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .criseLink i { animation: none; } }
