  :root{
    /* Palette 2048-like */
    --bg-light:#FAF8EF; --board-light:#BBADA0; --empty-light:#CDC1B4; --tile-light:#EEE4DA; --text-tile:#776E65;
    --bg-dark:#1F1B16;  --board-dark:#4A413A; --empty-dark:#5C524B; --tile-dark:#7A6E64; --text-tile-dark:#F5EFEA;
    --gap:12px; --radius:18px;
  }
  [data-theme="light"]{
    --bg:var(--bg-light); --board:var(--board-light); --empty:var(--empty-light); --tile:var(--tile-light); --text:var(--text-tile);
  }
  [data-theme="dark"]{
    --bg:var(--bg-dark); --board:var(--board-dark); --empty:var(--empty-dark); --tile:var(--tile-dark); --text:var(--text-tile-dark);
  }
  html,body{height:100%}
  body{
    margin:0; font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,"Noto Sans",sans-serif;
    background:var(--bg); color:var(--text);
  }
  .wrap{
    max-width:680px; margin:0 auto; padding:16px; display:flex; flex-direction:column; gap:12px;
  }
  .toprow{display:flex; align-items:center; justify-content:space-between;}
  h1{margin:0; font-size:1.8rem; font-weight:800}
  button, .chip{
    border:0; border-radius:999px; padding:8px 14px; background:var(--empty); color:var(--text);
    cursor:pointer; font-weight:600;
  }
  button:hover,.chip:hover{filter:brightness(0.98)}
  .chip.sel{outline:3px solid var(--board)}
  .row{display:flex; align-items:center; justify-content:space-between; gap:8px; flex-wrap:wrap}
  .stats{display:flex; gap:16px; align-items:center; flex-wrap:wrap}
  .board-wrap{width:100%; aspect-ratio:1/1; position:relative}
  canvas{width:100%; height:100%; display:block; border-radius:var(--radius); background:var(--board)}
  .sig{margin-left:auto; opacity:.7; font-size:.85rem}
  .badge{padding:6px 10px; border-radius:10px; background:var(--empty); font-weight:600}
  .controls{display:flex; gap:8px; align-items:center; flex-wrap:wrap}
  .theme-btn{display:flex; align-items:center; gap:8px}
  .sr{position:absolute; left:-10000px; top:auto; width:1px; height:1px; overflow:hidden;}
  /* [LOCK WIN] petit style utile si on veut aussi griser le plateau quand gagné */
  .board-locked{pointer-events:none; filter:grayscale(.15) contrast(.98)}

