/* Main UI font: Jersey 15 (SIL OFL, self-hosted). Open C/O shapes and clear digits; size-adjust keeps old layouts. */
@font-face { font-family: 'GameFont'; src: url(assets/fonts/jersey15-latin.woff2) format('woff2'); size-adjust: 118%; font-display: swap; }
@font-face { font-family: 'LogoFont'; src: url(assets/fonts/jersey10-latin.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: 'Silkscreen'; src: url(assets/fonts/silkscreen-latin.woff2) format('woff2'); font-display: swap; }
:root {
  --bg: #0b0812;
  --panel: #171121;
  --panel2: #221a30;
  --edge: #3b2d52;
  --edge2: #5c4680;
  --text: #efe6d6;
  --muted: #9a8fae;
  --gold: #ffd34a;
  --red: #ff5a4e;
  --blue: #4ea8ff;
  --green: #6bf27a;
  --common: #c9c9c9;
  --rare: #4ea8ff;
  --epic: #b45cff;
  --legendary: #ff9a2e;
  --font: 'GameFont', 'Pixelify Sans', ui-monospace, monospace;
  --logo: 'LogoFont', 'GameFont', ui-monospace, monospace;
  /* 9-slice pixel frames (generated by tools/pixelframes.py) */
  --pf-btn: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='7' height='7' shape-rendering='crispEdges'%3E%3Crect x='2' y='0' width='1' height='1' fill='%23000000'/%3E%3Crect x='3' y='0' width='1' height='1' fill='%23000000'/%3E%3Crect x='4' y='0' width='1' height='1' fill='%23000000'/%3E%3Crect x='1' y='1' width='1' height='1' fill='%23000000'/%3E%3Crect x='2' y='1' width='1' height='1' fill='%236a5490'/%3E%3Crect x='3' y='1' width='1' height='1' fill='%236a5490'/%3E%3Crect x='4' y='1' width='1' height='1' fill='%236a5490'/%3E%3Crect x='5' y='1' width='1' height='1' fill='%23000000'/%3E%3Crect x='0' y='2' width='1' height='1' fill='%23000000'/%3E%3Crect x='1' y='2' width='1' height='1' fill='%236a5490'/%3E%3Crect x='2' y='2' width='1' height='1' fill='%2333264a'/%3E%3Crect x='3' y='2' width='1' height='1' fill='%2333264a'/%3E%3Crect x='4' y='2' width='1' height='1' fill='%2333264a'/%3E%3Crect x='5' y='2' width='1' height='1' fill='%23160f22'/%3E%3Crect x='6' y='2' width='1' height='1' fill='%23000000'/%3E%3Crect x='0' y='3' width='1' height='1' fill='%23000000'/%3E%3Crect x='1' y='3' width='1' height='1' fill='%236a5490'/%3E%3Crect x='2' y='3' width='1' height='1' fill='%2333264a'/%3E%3Crect x='3' y='3' width='1' height='1' fill='%2333264a'/%3E%3Crect x='4' y='3' width='1' height='1' fill='%2333264a'/%3E%3Crect x='5' y='3' width='1' height='1' fill='%23160f22'/%3E%3Crect x='6' y='3' width='1' height='1' fill='%23000000'/%3E%3Crect x='0' y='4' width='1' height='1' fill='%23000000'/%3E%3Crect x='1' y='4' width='1' height='1' fill='%236a5490'/%3E%3Crect x='2' y='4' width='1' height='1' fill='%2333264a'/%3E%3Crect x='3' y='4' width='1' height='1' fill='%2333264a'/%3E%3Crect x='4' y='4' width='1' height='1' fill='%2333264a'/%3E%3Crect x='5' y='4' width='1' height='1' fill='%23160f22'/%3E%3Crect x='6' y='4' width='1' height='1' fill='%23000000'/%3E%3Crect x='1' y='5' width='1' height='1' fill='%23000000'/%3E%3Crect x='2' y='5' width='1' height='1' fill='%23160f22'/%3E%3Crect x='3' y='5' width='1' height='1' fill='%23160f22'/%3E%3Crect x='4' y='5' width='1' height='1' fill='%23160f22'/%3E%3Crect x='5' y='5' width='1' height='1' fill='%23000000'/%3E%3Crect x='2' y='6' width='1' height='1' fill='%23000000'/%3E%3Crect x='3' y='6' width='1' height='1' fill='%23000000'/%3E%3Crect x='4' y='6' width='1' height='1' fill='%23000000'/%3E%3C/svg%3E");
  --pf-btn-on: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='7' height='7' shape-rendering='crispEdges'%3E%3Crect x='2' y='0' width='1' height='1' fill='%23ffd34a'/%3E%3Crect x='3' y='0' width='1' height='1' fill='%23ffd34a'/%3E%3Crect x='4' y='0' width='1' height='1' fill='%23ffd34a'/%3E%3Crect x='1' y='1' width='1' height='1' fill='%23ffd34a'/%3E%3Crect x='2' y='1' width='1' height='1' fill='%23a688dc'/%3E%3Crect x='3' y='1' width='1' height='1' fill='%23a688dc'/%3E%3Crect x='4' y='1' width='1' height='1' fill='%23a688dc'/%3E%3Crect x='5' y='1' width='1' height='1' fill='%23ffd34a'/%3E%3Crect x='0' y='2' width='1' height='1' fill='%23ffd34a'/%3E%3Crect x='1' y='2' width='1' height='1' fill='%23a688dc'/%3E%3Crect x='2' y='2' width='1' height='1' fill='%234e3a72'/%3E%3Crect x='3' y='2' width='1' height='1' fill='%234e3a72'/%3E%3Crect x='4' y='2' width='1' height='1' fill='%234e3a72'/%3E%3Crect x='5' y='2' width='1' height='1' fill='%2322183a'/%3E%3Crect x='6' y='2' width='1' height='1' fill='%23ffd34a'/%3E%3Crect x='0' y='3' width='1' height='1' fill='%23ffd34a'/%3E%3Crect x='1' y='3' width='1' height='1' fill='%23a688dc'/%3E%3Crect x='2' y='3' width='1' height='1' fill='%234e3a72'/%3E%3Crect x='3' y='3' width='1' height='1' fill='%234e3a72'/%3E%3Crect x='4' y='3' width='1' height='1' fill='%234e3a72'/%3E%3Crect x='5' y='3' width='1' height='1' fill='%2322183a'/%3E%3Crect x='6' y='3' width='1' height='1' fill='%23ffd34a'/%3E%3Crect x='0' y='4' width='1' height='1' fill='%23ffd34a'/%3E%3Crect x='1' y='4' width='1' height='1' fill='%23a688dc'/%3E%3Crect x='2' y='4' width='1' height='1' fill='%234e3a72'/%3E%3Crect x='3' y='4' width='1' height='1' fill='%234e3a72'/%3E%3Crect x='4' y='4' width='1' height='1' fill='%234e3a72'/%3E%3Crect x='5' y='4' width='1' height='1' fill='%2322183a'/%3E%3Crect x='6' y='4' width='1' height='1' fill='%23ffd34a'/%3E%3Crect x='1' y='5' width='1' height='1' fill='%23ffd34a'/%3E%3Crect x='2' y='5' width='1' height='1' fill='%2322183a'/%3E%3Crect x='3' y='5' width='1' height='1' fill='%2322183a'/%3E%3Crect x='4' y='5' width='1' height='1' fill='%2322183a'/%3E%3Crect x='5' y='5' width='1' height='1' fill='%23ffd34a'/%3E%3Crect x='2' y='6' width='1' height='1' fill='%23ffd34a'/%3E%3Crect x='3' y='6' width='1' height='1' fill='%23ffd34a'/%3E%3Crect x='4' y='6' width='1' height='1' fill='%23ffd34a'/%3E%3C/svg%3E");
  --pf-btn-gold: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='7' height='7' shape-rendering='crispEdges'%3E%3Crect x='2' y='0' width='1' height='1' fill='%23000000'/%3E%3Crect x='3' y='0' width='1' height='1' fill='%23000000'/%3E%3Crect x='4' y='0' width='1' height='1' fill='%23000000'/%3E%3Crect x='1' y='1' width='1' height='1' fill='%23000000'/%3E%3Crect x='2' y='1' width='1' height='1' fill='%23e8b84a'/%3E%3Crect x='3' y='1' width='1' height='1' fill='%23e8b84a'/%3E%3Crect x='4' y='1' width='1' height='1' fill='%23e8b84a'/%3E%3Crect x='5' y='1' width='1' height='1' fill='%23000000'/%3E%3Crect x='0' y='2' width='1' height='1' fill='%23000000'/%3E%3Crect x='1' y='2' width='1' height='1' fill='%23e8b84a'/%3E%3Crect x='2' y='2' width='1' height='1' fill='%2380601a'/%3E%3Crect x='3' y='2' width='1' height='1' fill='%2380601a'/%3E%3Crect x='4' y='2' width='1' height='1' fill='%2380601a'/%3E%3Crect x='5' y='2' width='1' height='1' fill='%233a2806'/%3E%3Crect x='6' y='2' width='1' height='1' fill='%23000000'/%3E%3Crect x='0' y='3' width='1' height='1' fill='%23000000'/%3E%3Crect x='1' y='3' width='1' height='1' fill='%23e8b84a'/%3E%3Crect x='2' y='3' width='1' height='1' fill='%2380601a'/%3E%3Crect x='3' y='3' width='1' height='1' fill='%2380601a'/%3E%3Crect x='4' y='3' width='1' height='1' fill='%2380601a'/%3E%3Crect x='5' y='3' width='1' height='1' fill='%233a2806'/%3E%3Crect x='6' y='3' width='1' height='1' fill='%23000000'/%3E%3Crect x='0' y='4' width='1' height='1' fill='%23000000'/%3E%3Crect x='1' y='4' width='1' height='1' fill='%23e8b84a'/%3E%3Crect x='2' y='4' width='1' height='1' fill='%2380601a'/%3E%3Crect x='3' y='4' width='1' height='1' fill='%2380601a'/%3E%3Crect x='4' y='4' width='1' height='1' fill='%2380601a'/%3E%3Crect x='5' y='4' width='1' height='1' fill='%233a2806'/%3E%3Crect x='6' y='4' width='1' height='1' fill='%23000000'/%3E%3Crect x='1' y='5' width='1' height='1' fill='%23000000'/%3E%3Crect x='2' y='5' width='1' height='1' fill='%233a2806'/%3E%3Crect x='3' y='5' width='1' height='1' fill='%233a2806'/%3E%3Crect x='4' y='5' width='1' height='1' fill='%233a2806'/%3E%3Crect x='5' y='5' width='1' height='1' fill='%23000000'/%3E%3Crect x='2' y='6' width='1' height='1' fill='%23000000'/%3E%3Crect x='3' y='6' width='1' height='1' fill='%23000000'/%3E%3Crect x='4' y='6' width='1' height='1' fill='%23000000'/%3E%3C/svg%3E");
  --pf-btn-gold-on: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='7' height='7' shape-rendering='crispEdges'%3E%3Crect x='2' y='0' width='1' height='1' fill='%23fff2c0'/%3E%3Crect x='3' y='0' width='1' height='1' fill='%23fff2c0'/%3E%3Crect x='4' y='0' width='1' height='1' fill='%23fff2c0'/%3E%3Crect x='1' y='1' width='1' height='1' fill='%23fff2c0'/%3E%3Crect x='2' y='1' width='1' height='1' fill='%23ffe08a'/%3E%3Crect x='3' y='1' width='1' height='1' fill='%23ffe08a'/%3E%3Crect x='4' y='1' width='1' height='1' fill='%23ffe08a'/%3E%3Crect x='5' y='1' width='1' height='1' fill='%23fff2c0'/%3E%3Crect x='0' y='2' width='1' height='1' fill='%23fff2c0'/%3E%3Crect x='1' y='2' width='1' height='1' fill='%23ffe08a'/%3E%3Crect x='2' y='2' width='1' height='1' fill='%23a07a22'/%3E%3Crect x='3' y='2' width='1' height='1' fill='%23a07a22'/%3E%3Crect x='4' y='2' width='1' height='1' fill='%23a07a22'/%3E%3Crect x='5' y='2' width='1' height='1' fill='%234a3608'/%3E%3Crect x='6' y='2' width='1' height='1' fill='%23fff2c0'/%3E%3Crect x='0' y='3' width='1' height='1' fill='%23fff2c0'/%3E%3Crect x='1' y='3' width='1' height='1' fill='%23ffe08a'/%3E%3Crect x='2' y='3' width='1' height='1' fill='%23a07a22'/%3E%3Crect x='3' y='3' width='1' height='1' fill='%23a07a22'/%3E%3Crect x='4' y='3' width='1' height='1' fill='%23a07a22'/%3E%3Crect x='5' y='3' width='1' height='1' fill='%234a3608'/%3E%3Crect x='6' y='3' width='1' height='1' fill='%23fff2c0'/%3E%3Crect x='0' y='4' width='1' height='1' fill='%23fff2c0'/%3E%3Crect x='1' y='4' width='1' height='1' fill='%23ffe08a'/%3E%3Crect x='2' y='4' width='1' height='1' fill='%23a07a22'/%3E%3Crect x='3' y='4' width='1' height='1' fill='%23a07a22'/%3E%3Crect x='4' y='4' width='1' height='1' fill='%23a07a22'/%3E%3Crect x='5' y='4' width='1' height='1' fill='%234a3608'/%3E%3Crect x='6' y='4' width='1' height='1' fill='%23fff2c0'/%3E%3Crect x='1' y='5' width='1' height='1' fill='%23fff2c0'/%3E%3Crect x='2' y='5' width='1' height='1' fill='%234a3608'/%3E%3Crect x='3' y='5' width='1' height='1' fill='%234a3608'/%3E%3Crect x='4' y='5' width='1' height='1' fill='%234a3608'/%3E%3Crect x='5' y='5' width='1' height='1' fill='%23fff2c0'/%3E%3Crect x='2' y='6' width='1' height='1' fill='%23fff2c0'/%3E%3Crect x='3' y='6' width='1' height='1' fill='%23fff2c0'/%3E%3Crect x='4' y='6' width='1' height='1' fill='%23fff2c0'/%3E%3C/svg%3E");
  --pf-btn-red: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='7' height='7' shape-rendering='crispEdges'%3E%3Crect x='2' y='0' width='1' height='1' fill='%23000000'/%3E%3Crect x='3' y='0' width='1' height='1' fill='%23000000'/%3E%3Crect x='4' y='0' width='1' height='1' fill='%23000000'/%3E%3Crect x='1' y='1' width='1' height='1' fill='%23000000'/%3E%3Crect x='2' y='1' width='1' height='1' fill='%23c25a5a'/%3E%3Crect x='3' y='1' width='1' height='1' fill='%23c25a5a'/%3E%3Crect x='4' y='1' width='1' height='1' fill='%23c25a5a'/%3E%3Crect x='5' y='1' width='1' height='1' fill='%23000000'/%3E%3Crect x='0' y='2' width='1' height='1' fill='%23000000'/%3E%3Crect x='1' y='2' width='1' height='1' fill='%23c25a5a'/%3E%3Crect x='2' y='2' width='1' height='1' fill='%236e2424'/%3E%3Crect x='3' y='2' width='1' height='1' fill='%236e2424'/%3E%3Crect x='4' y='2' width='1' height='1' fill='%236e2424'/%3E%3Crect x='5' y='2' width='1' height='1' fill='%23300c0c'/%3E%3Crect x='6' y='2' width='1' height='1' fill='%23000000'/%3E%3Crect x='0' y='3' width='1' height='1' fill='%23000000'/%3E%3Crect x='1' y='3' width='1' height='1' fill='%23c25a5a'/%3E%3Crect x='2' y='3' width='1' height='1' fill='%236e2424'/%3E%3Crect x='3' y='3' width='1' height='1' fill='%236e2424'/%3E%3Crect x='4' y='3' width='1' height='1' fill='%236e2424'/%3E%3Crect x='5' y='3' width='1' height='1' fill='%23300c0c'/%3E%3Crect x='6' y='3' width='1' height='1' fill='%23000000'/%3E%3Crect x='0' y='4' width='1' height='1' fill='%23000000'/%3E%3Crect x='1' y='4' width='1' height='1' fill='%23c25a5a'/%3E%3Crect x='2' y='4' width='1' height='1' fill='%236e2424'/%3E%3Crect x='3' y='4' width='1' height='1' fill='%236e2424'/%3E%3Crect x='4' y='4' width='1' height='1' fill='%236e2424'/%3E%3Crect x='5' y='4' width='1' height='1' fill='%23300c0c'/%3E%3Crect x='6' y='4' width='1' height='1' fill='%23000000'/%3E%3Crect x='1' y='5' width='1' height='1' fill='%23000000'/%3E%3Crect x='2' y='5' width='1' height='1' fill='%23300c0c'/%3E%3Crect x='3' y='5' width='1' height='1' fill='%23300c0c'/%3E%3Crect x='4' y='5' width='1' height='1' fill='%23300c0c'/%3E%3Crect x='5' y='5' width='1' height='1' fill='%23000000'/%3E%3Crect x='2' y='6' width='1' height='1' fill='%23000000'/%3E%3Crect x='3' y='6' width='1' height='1' fill='%23000000'/%3E%3Crect x='4' y='6' width='1' height='1' fill='%23000000'/%3E%3C/svg%3E");
  --pf-btn-red-on: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='7' height='7' shape-rendering='crispEdges'%3E%3Crect x='2' y='0' width='1' height='1' fill='%23ffd34a'/%3E%3Crect x='3' y='0' width='1' height='1' fill='%23ffd34a'/%3E%3Crect x='4' y='0' width='1' height='1' fill='%23ffd34a'/%3E%3Crect x='1' y='1' width='1' height='1' fill='%23ffd34a'/%3E%3Crect x='2' y='1' width='1' height='1' fill='%23ff8a7a'/%3E%3Crect x='3' y='1' width='1' height='1' fill='%23ff8a7a'/%3E%3Crect x='4' y='1' width='1' height='1' fill='%23ff8a7a'/%3E%3Crect x='5' y='1' width='1' height='1' fill='%23ffd34a'/%3E%3Crect x='0' y='2' width='1' height='1' fill='%23ffd34a'/%3E%3Crect x='1' y='2' width='1' height='1' fill='%23ff8a7a'/%3E%3Crect x='2' y='2' width='1' height='1' fill='%238e3030'/%3E%3Crect x='3' y='2' width='1' height='1' fill='%238e3030'/%3E%3Crect x='4' y='2' width='1' height='1' fill='%238e3030'/%3E%3Crect x='5' y='2' width='1' height='1' fill='%233a1010'/%3E%3Crect x='6' y='2' width='1' height='1' fill='%23ffd34a'/%3E%3Crect x='0' y='3' width='1' height='1' fill='%23ffd34a'/%3E%3Crect x='1' y='3' width='1' height='1' fill='%23ff8a7a'/%3E%3Crect x='2' y='3' width='1' height='1' fill='%238e3030'/%3E%3Crect x='3' y='3' width='1' height='1' fill='%238e3030'/%3E%3Crect x='4' y='3' width='1' height='1' fill='%238e3030'/%3E%3Crect x='5' y='3' width='1' height='1' fill='%233a1010'/%3E%3Crect x='6' y='3' width='1' height='1' fill='%23ffd34a'/%3E%3Crect x='0' y='4' width='1' height='1' fill='%23ffd34a'/%3E%3Crect x='1' y='4' width='1' height='1' fill='%23ff8a7a'/%3E%3Crect x='2' y='4' width='1' height='1' fill='%238e3030'/%3E%3Crect x='3' y='4' width='1' height='1' fill='%238e3030'/%3E%3Crect x='4' y='4' width='1' height='1' fill='%238e3030'/%3E%3Crect x='5' y='4' width='1' height='1' fill='%233a1010'/%3E%3Crect x='6' y='4' width='1' height='1' fill='%23ffd34a'/%3E%3Crect x='1' y='5' width='1' height='1' fill='%23ffd34a'/%3E%3Crect x='2' y='5' width='1' height='1' fill='%233a1010'/%3E%3Crect x='3' y='5' width='1' height='1' fill='%233a1010'/%3E%3Crect x='4' y='5' width='1' height='1' fill='%233a1010'/%3E%3Crect x='5' y='5' width='1' height='1' fill='%23ffd34a'/%3E%3Crect x='2' y='6' width='1' height='1' fill='%23ffd34a'/%3E%3Crect x='3' y='6' width='1' height='1' fill='%23ffd34a'/%3E%3Crect x='4' y='6' width='1' height='1' fill='%23ffd34a'/%3E%3C/svg%3E");
  --pf-tab: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='7' height='7' shape-rendering='crispEdges'%3E%3Crect x='2' y='0' width='1' height='1' fill='%23000000'/%3E%3Crect x='3' y='0' width='1' height='1' fill='%23000000'/%3E%3Crect x='4' y='0' width='1' height='1' fill='%23000000'/%3E%3Crect x='1' y='1' width='1' height='1' fill='%23000000'/%3E%3Crect x='2' y='1' width='1' height='1' fill='%233a2c52'/%3E%3Crect x='3' y='1' width='1' height='1' fill='%233a2c52'/%3E%3Crect x='4' y='1' width='1' height='1' fill='%233a2c52'/%3E%3Crect x='5' y='1' width='1' height='1' fill='%23000000'/%3E%3Crect x='0' y='2' width='1' height='1' fill='%23000000'/%3E%3Crect x='1' y='2' width='1' height='1' fill='%233a2c52'/%3E%3Crect x='2' y='2' width='1' height='1' fill='%231d1529'/%3E%3Crect x='3' y='2' width='1' height='1' fill='%231d1529'/%3E%3Crect x='4' y='2' width='1' height='1' fill='%231d1529'/%3E%3Crect x='5' y='2' width='1' height='1' fill='%230e0a16'/%3E%3Crect x='6' y='2' width='1' height='1' fill='%23000000'/%3E%3Crect x='0' y='3' width='1' height='1' fill='%23000000'/%3E%3Crect x='1' y='3' width='1' height='1' fill='%233a2c52'/%3E%3Crect x='2' y='3' width='1' height='1' fill='%231d1529'/%3E%3Crect x='3' y='3' width='1' height='1' fill='%231d1529'/%3E%3Crect x='4' y='3' width='1' height='1' fill='%231d1529'/%3E%3Crect x='5' y='3' width='1' height='1' fill='%230e0a16'/%3E%3Crect x='6' y='3' width='1' height='1' fill='%23000000'/%3E%3Crect x='0' y='4' width='1' height='1' fill='%23000000'/%3E%3Crect x='1' y='4' width='1' height='1' fill='%233a2c52'/%3E%3Crect x='2' y='4' width='1' height='1' fill='%231d1529'/%3E%3Crect x='3' y='4' width='1' height='1' fill='%231d1529'/%3E%3Crect x='4' y='4' width='1' height='1' fill='%231d1529'/%3E%3Crect x='5' y='4' width='1' height='1' fill='%230e0a16'/%3E%3Crect x='6' y='4' width='1' height='1' fill='%23000000'/%3E%3Crect x='1' y='5' width='1' height='1' fill='%23000000'/%3E%3Crect x='2' y='5' width='1' height='1' fill='%230e0a16'/%3E%3Crect x='3' y='5' width='1' height='1' fill='%230e0a16'/%3E%3Crect x='4' y='5' width='1' height='1' fill='%230e0a16'/%3E%3Crect x='5' y='5' width='1' height='1' fill='%23000000'/%3E%3Crect x='2' y='6' width='1' height='1' fill='%23000000'/%3E%3Crect x='3' y='6' width='1' height='1' fill='%23000000'/%3E%3Crect x='4' y='6' width='1' height='1' fill='%23000000'/%3E%3C/svg%3E");
  --pf-tab-on: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='7' height='7' shape-rendering='crispEdges'%3E%3Crect x='2' y='0' width='1' height='1' fill='%23000000'/%3E%3Crect x='3' y='0' width='1' height='1' fill='%23000000'/%3E%3Crect x='4' y='0' width='1' height='1' fill='%23000000'/%3E%3Crect x='1' y='1' width='1' height='1' fill='%23000000'/%3E%3Crect x='2' y='1' width='1' height='1' fill='%237a62a8'/%3E%3Crect x='3' y='1' width='1' height='1' fill='%237a62a8'/%3E%3Crect x='4' y='1' width='1' height='1' fill='%237a62a8'/%3E%3Crect x='5' y='1' width='1' height='1' fill='%23000000'/%3E%3Crect x='0' y='2' width='1' height='1' fill='%23000000'/%3E%3Crect x='1' y='2' width='1' height='1' fill='%237a62a8'/%3E%3Crect x='2' y='2' width='1' height='1' fill='%233a2c52'/%3E%3Crect x='3' y='2' width='1' height='1' fill='%233a2c52'/%3E%3Crect x='4' y='2' width='1' height='1' fill='%233a2c52'/%3E%3Crect x='5' y='2' width='1' height='1' fill='%231a1228'/%3E%3Crect x='6' y='2' width='1' height='1' fill='%23000000'/%3E%3Crect x='0' y='3' width='1' height='1' fill='%23000000'/%3E%3Crect x='1' y='3' width='1' height='1' fill='%237a62a8'/%3E%3Crect x='2' y='3' width='1' height='1' fill='%233a2c52'/%3E%3Crect x='3' y='3' width='1' height='1' fill='%233a2c52'/%3E%3Crect x='4' y='3' width='1' height='1' fill='%233a2c52'/%3E%3Crect x='5' y='3' width='1' height='1' fill='%231a1228'/%3E%3Crect x='6' y='3' width='1' height='1' fill='%23000000'/%3E%3Crect x='0' y='4' width='1' height='1' fill='%23000000'/%3E%3Crect x='1' y='4' width='1' height='1' fill='%237a62a8'/%3E%3Crect x='2' y='4' width='1' height='1' fill='%233a2c52'/%3E%3Crect x='3' y='4' width='1' height='1' fill='%233a2c52'/%3E%3Crect x='4' y='4' width='1' height='1' fill='%233a2c52'/%3E%3Crect x='5' y='4' width='1' height='1' fill='%231a1228'/%3E%3Crect x='6' y='4' width='1' height='1' fill='%23000000'/%3E%3Crect x='1' y='5' width='1' height='1' fill='%23000000'/%3E%3Crect x='2' y='5' width='1' height='1' fill='%231a1228'/%3E%3Crect x='3' y='5' width='1' height='1' fill='%231a1228'/%3E%3Crect x='4' y='5' width='1' height='1' fill='%231a1228'/%3E%3Crect x='5' y='5' width='1' height='1' fill='%23000000'/%3E%3Crect x='2' y='6' width='1' height='1' fill='%23000000'/%3E%3Crect x='3' y='6' width='1' height='1' fill='%23000000'/%3E%3Crect x='4' y='6' width='1' height='1' fill='%23000000'/%3E%3C/svg%3E");
  --pf-panel: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='9' height='9' shape-rendering='crispEdges'%3E%3Crect x='3' y='0' width='1' height='1' fill='%23000000'/%3E%3Crect x='4' y='0' width='1' height='1' fill='%23000000'/%3E%3Crect x='5' y='0' width='1' height='1' fill='%23000000'/%3E%3Crect x='2' y='1' width='1' height='1' fill='%23000000'/%3E%3Crect x='3' y='1' width='1' height='1' fill='%234a3a66'/%3E%3Crect x='4' y='1' width='1' height='1' fill='%234a3a66'/%3E%3Crect x='5' y='1' width='1' height='1' fill='%234a3a66'/%3E%3Crect x='6' y='1' width='1' height='1' fill='%23000000'/%3E%3Crect x='1' y='2' width='1' height='1' fill='%23000000'/%3E%3Crect x='2' y='2' width='1' height='1' fill='%234a3a66'/%3E%3Crect x='3' y='2' width='1' height='1' fill='%23000000'/%3E%3Crect x='4' y='2' width='1' height='1' fill='%23000000'/%3E%3Crect x='5' y='2' width='1' height='1' fill='%23000000'/%3E%3Crect x='6' y='2' width='1' height='1' fill='%234a3a66'/%3E%3Crect x='7' y='2' width='1' height='1' fill='%23000000'/%3E%3Crect x='0' y='3' width='1' height='1' fill='%23000000'/%3E%3Crect x='1' y='3' width='1' height='1' fill='%234a3a66'/%3E%3Crect x='2' y='3' width='1' height='1' fill='%23000000'/%3E%3Crect x='3' y='3' width='1' height='1' fill='%232e2344'/%3E%3Crect x='4' y='3' width='1' height='1' fill='%232e2344'/%3E%3Crect x='5' y='3' width='1' height='1' fill='%232e2344'/%3E%3Crect x='6' y='3' width='1' height='1' fill='%23000000'/%3E%3Crect x='7' y='3' width='1' height='1' fill='%232a1f3c'/%3E%3Crect x='8' y='3' width='1' height='1' fill='%23000000'/%3E%3Crect x='0' y='4' width='1' height='1' fill='%23000000'/%3E%3Crect x='1' y='4' width='1' height='1' fill='%234a3a66'/%3E%3Crect x='2' y='4' width='1' height='1' fill='%23000000'/%3E%3Crect x='3' y='4' width='1' height='1' fill='%232e2344'/%3E%3Crect x='5' y='4' width='1' height='1' fill='%231a1326'/%3E%3Crect x='6' y='4' width='1' height='1' fill='%23000000'/%3E%3Crect x='7' y='4' width='1' height='1' fill='%232a1f3c'/%3E%3Crect x='8' y='4' width='1' height='1' fill='%23000000'/%3E%3Crect x='0' y='5' width='1' height='1' fill='%23000000'/%3E%3Crect x='1' y='5' width='1' height='1' fill='%234a3a66'/%3E%3Crect x='2' y='5' width='1' height='1' fill='%23000000'/%3E%3Crect x='3' y='5' width='1' height='1' fill='%231a1326'/%3E%3Crect x='4' y='5' width='1' height='1' fill='%231a1326'/%3E%3Crect x='5' y='5' width='1' height='1' fill='%231a1326'/%3E%3Crect x='6' y='5' width='1' height='1' fill='%23000000'/%3E%3Crect x='7' y='5' width='1' height='1' fill='%232a1f3c'/%3E%3Crect x='8' y='5' width='1' height='1' fill='%23000000'/%3E%3Crect x='1' y='6' width='1' height='1' fill='%23000000'/%3E%3Crect x='2' y='6' width='1' height='1' fill='%232a1f3c'/%3E%3Crect x='3' y='6' width='1' height='1' fill='%23000000'/%3E%3Crect x='4' y='6' width='1' height='1' fill='%23000000'/%3E%3Crect x='5' y='6' width='1' height='1' fill='%23000000'/%3E%3Crect x='6' y='6' width='1' height='1' fill='%232a1f3c'/%3E%3Crect x='7' y='6' width='1' height='1' fill='%23000000'/%3E%3Crect x='2' y='7' width='1' height='1' fill='%23000000'/%3E%3Crect x='3' y='7' width='1' height='1' fill='%232a1f3c'/%3E%3Crect x='4' y='7' width='1' height='1' fill='%232a1f3c'/%3E%3Crect x='5' y='7' width='1' height='1' fill='%232a1f3c'/%3E%3Crect x='6' y='7' width='1' height='1' fill='%23000000'/%3E%3Crect x='3' y='8' width='1' height='1' fill='%23000000'/%3E%3Crect x='4' y='8' width='1' height='1' fill='%23000000'/%3E%3Crect x='5' y='8' width='1' height='1' fill='%23000000'/%3E%3C/svg%3E");
  --font2: 'Silkscreen', 'Pixelify Sans', ui-monospace, monospace;
}
* { box-sizing: border-box; }
html, body { font-variant-ligatures: none; margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text); font-family: var(--font); user-select: none; }
canvas { image-rendering: pixelated; image-rendering: crisp-edges; }
#gl, #overlay { position: fixed; inset: 0; }
#screen canvas { position: static; vertical-align: middle; }
#overlay { pointer-events: none; }
#ui { position: fixed; inset: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); pointer-events: none; }   /* the game view fills the screen; menus and HUD keep clear of notches */
#ui > * { pointer-events: none; }
#screen > *, #levelups .lv-panel, #hud .clickable { pointer-events: auto; }
.hidden { display: none !important; }

/* ---------- pixel panels & buttons ---------- */
.panel {
  background: linear-gradient(180deg, var(--panel2), var(--panel)) padding-box;
  border: 8px solid transparent; border-image: var(--pf-panel) 4 / 8px stretch;
  box-shadow: 0 10px 30px rgba(0,0,0,.55);
  padding: 12px 14px;
}
.btn {
  position: relative; font-family: var(--font); font-size: 20px; color: var(--text); cursor: pointer; text-align: left; min-width: 220px;
  background: none; border: 6px solid transparent; border-image: var(--pf-btn) 3 fill / 6px stretch;
  padding: 4px 12px; margin: 4px 0; text-shadow: 0 2px 0 rgba(0,0,0,.55);
  transition: transform .06s, filter .06s;
}
.btn:hover, .btn.sel { border-image-source: var(--pf-btn-on); color: #fff; transform: translateY(-2px); filter: drop-shadow(0 3px 0 rgba(0,0,0,.55)); }
.btn:active:not(:disabled) { transform: translateY(1px); filter: none; }
/* focus marker: a small pixel arrow just outside the button, so the label never shifts */
.btn.sel::before { content: ''; position: absolute; left: -16px; top: 50%; margin-top: -6px; border: 6px solid transparent; border-left: 7px solid var(--gold); filter: drop-shadow(1px 1px 0 #000); }
.btn.small { font-size: 15px; padding: 1px 6px; min-width: 0; }
.btn.small.sel::before { left: -13px; margin-top: -5px; border-width: 5px; border-left-width: 6px; }
.btn.gold { border-image-source: var(--pf-btn-gold); color: #fff6dc; }
.btn.gold:hover, .btn.gold.sel { border-image-source: var(--pf-btn-gold-on); }
.btn.danger { border-image-source: var(--pf-btn-red); }
.btn.danger:hover, .btn.danger.sel { border-image-source: var(--pf-btn-red-on); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; filter: grayscale(.5); }
h1, h2, h3 { font-weight: 700; margin: 0 0 8px; letter-spacing: 1px; }
.muted { color: var(--muted); }
.gold { color: var(--gold); }
.row { display: flex; gap: 12px; align-items: center; }
.col { display: flex; flex-direction: column; gap: 6px; }
.center { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.screen-full { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.dim { background: radial-gradient(ellipse at center, rgba(8,4,16,.35), rgba(8,4,16,.85)); }
kbd { font-family: var(--font2); font-size: 11px; background: #000; border: 1px solid var(--edge2); padding: 1px 5px; color: var(--gold); border-radius: 2px; }
input[type=text] { font-family: var(--font); font-size: 20px; background: #0b0812; color: var(--text); border: none; box-shadow: 0 0 0 2px var(--edge2); padding: 8px 10px; width: 220px; outline: none; }
input[type=range] { width: 200px; accent-color: var(--gold); }

/* ---------- title ---------- */
.logo { font-family: var(--font); font-size: clamp(42px, calc(7 * var(--vw, 1vw)), 92px); font-weight: 700; line-height: .9; text-align: center;
  color: #ffe9b0; text-shadow: 0 4px 0 #a2521a, 0 8px 0 #4a1a0a, 0 0 40px rgba(255,160,60,.45); letter-spacing: 3px; }
.logo small { display: block; font-size: .32em; color: #c590ff; text-shadow: 0 3px 0 #2a0a4a; letter-spacing: 8px; margin-top: 14px; }
.title-wrap { display: flex; flex-direction: column; align-items: center; gap: 28px; }
.press { font-size: 22px; animation: blink 1.2s steps(2) infinite; color: var(--gold); }
@keyframes blink { 50% { opacity: .2; } }
.footer-note { position: absolute; bottom: 14px; left: 0; right: 0; text-align: center; font-size: 13px; color: var(--muted); }

/* ---------- lobby ---------- */
.lobby { display: grid; grid-template-columns: repeat(4, minmax(170px, 230px)); gap: 18px; }
.slot { min-height: 330px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; position: relative; }
.slot.empty { opacity: .55; justify-content: center; }
.slot .who { font-size: 13px; color: var(--muted); }
.slot .cname { font-size: 24px; font-weight: 700; }
.slot .ctitle { font-size: 13px; color: var(--muted); margin-top: -6px; }
.slot .role { font-size: 12px; padding: 2px 8px; background: #000; }
.slot .desc { font-size: 13px; color: #cfc4df; line-height: 1.3; min-height: 52px; }
.slot canvas.portrait { position: static; width: 112px; height: 112px; image-rendering: pixelated; background: radial-gradient(circle, #2a2040, #120d1c); box-shadow: 0 0 0 2px #000, 0 0 0 4px var(--edge); }
.slot .arrows { display: flex; gap: 8px; align-items: center; justify-content: center; width: 100%; }
.slot .ready-tag { font-size: 18px; color: var(--green); }
/* a bot's slot in a lobby: its hero can be picked (Auto fills a missing role) */
.slot.bot { opacity: .9; }
.slot.bot .who { color: #c8b8e0; }
.slot.bot canvas.portrait { filter: saturate(.75); }
.slot.bot.bsel { box-shadow: 0 0 0 2px #000, 0 0 0 4px var(--gold); }
.slot.bot .bauto { font-size: 12px; color: var(--gold); }
.slot.bot .bjoin { font-size: 11px; color: var(--muted); margin-top: auto; }
.slot .pcolor { position: absolute; top: 0; left: 0; right: 0; height: 5px; }
.opts { display: flex; gap: 20px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.toggle { cursor: pointer; font-size: 16px; }
.toggle b { color: var(--gold); }

/* ---------- HUD ---------- */
#hud { position: absolute; inset: 0; font-family: var(--font); }
.hud-top { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); text-align: center; width: min(560px, calc(60 * var(--vw, 1vw))); }
.hud-wave { font-size: 22px; font-weight: 700; text-shadow: 0 2px 0 #000; }
.hud-wave span { color: var(--muted); font-size: 15px; font-weight: 400; }
.bar { height: 12px; background: #120d18; box-shadow: 0 0 0 2px #000; position: relative; overflow: hidden; }
.bar > i { position: absolute; left: 0; top: 0; bottom: 0; transition: width .15s; }
.bar > i.sh { background: rgba(154,216,255,.7); }
.bar.crystal > i.hp { background: linear-gradient(180deg, #8ff4ff, #2a8aff); }
.bar.boss { height: 16px; margin-top: 6px; }
.bar.boss > i.hp { background: linear-gradient(180deg, #ff7a6a, #a01a2a); }
.bar-label { font-size: 12px; color: #cfe8ff; margin: 6px 0 2px; text-shadow: 0 1px 0 #000; }
.boss-name { font-size: 18px; color: #ffb0a0; margin-top: 8px; text-shadow: 0 2px 0 #000; }
.hud-elite { margin: 6px auto 0; width: min(380px, calc(90 * var(--vw, 1vw))); text-shadow: 0 1px 0 #000, 0 0 3px #000; }
.hud-elite .el-name { font-size: 14px; color: #fff; text-align: center; }
.bar.elitebar { height: 8px; margin-top: 3px; } .bar.elitebar > i.hp { background: linear-gradient(180deg, #ffd27a, #c06a10); transition: width .12s linear; }
.bar.elitebar .el-num { display: none; }
.hud-elite .el-info { margin-top: 3px; font-size: 12px; text-align: center; color: #e8e0f0; }
.hud-elite .el-info i { font-style: normal; color: #8a7f9a; margin: 0 6px; }
.hud-elite .el-info span { white-space: nowrap; }
.hud-left { position: absolute; top: 10px; left: 12px; width: 230px; }
.hud-right { position: absolute; top: 10px; right: 12px; text-align: right; font-size: 16px; text-shadow: 0 2px 0 #000; line-height: 1.4; }
.lvl { font-size: 18px; text-shadow: 0 2px 0 #000; }
.bar.xp > i { background: linear-gradient(180deg, #a6ffd8, #2ac88a); }
.timer { font-size: 15px; color: var(--gold); margin-top: 6px; text-shadow: 0 2px 0 #000; }
.hud-heroes { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); display: flex; gap: 10px; }
.hcard { width: 236px; background: linear-gradient(180deg, rgba(30,22,44,.92), rgba(14,10,22,.92)); box-shadow: 0 0 0 2px #000, inset 0 0 0 1px #3a2c52; padding: 6px 7px 6px 10px; display: grid; grid-template-columns: 50px 1fr; gap: 8px; position: relative; overflow: hidden; }
.hcard::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--pc); }
.hcard.local { box-shadow: 0 0 0 2px #000, inset 0 0 0 1px var(--pc), 0 0 12px -2px var(--pc); }
.hcard.ultready::after { content: ''; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 14px rgba(255,211,74,.35); }
.hcard .hc-port { position: relative; align-self: start; }
.hcard canvas { position: static; display: block; width: 50px; height: 50px; image-rendering: pixelated; background: radial-gradient(circle at 50% 40%, #2e2244, #120d1c); box-shadow: 0 0 0 1px #000, inset 0 0 0 1px var(--pc); }
.hcard .hc-tag { position: absolute; left: 50%; bottom: -7px; transform: translateX(-50%); font-family: var(--font2); font-size: 9px; padding: 1px 4px; background: var(--pc); color: #120d1c; box-shadow: 0 0 0 1px #000; white-space: nowrap; }
.hcard .hc-main { min-width: 0; }
.hcard .nm { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #fff; line-height: 1.1; }
.hcard .nm .cl { color: #9a8fb0; font-size: 11px; }
.hcard .bar { height: 14px; margin: 3px 0 0; }
.hcard .bar .hpt { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; line-height: 1; color: #fff; text-shadow: 1px 0 0 #000, -1px 0 0 #000, 0 1px 0 #000, 0 -1px 0 #000; z-index: 1; pointer-events: none; }
.hcard .bar > i.hp { background: linear-gradient(180deg, #8aff8a, #2a9a3a); }
.hcard.lowhp .bar > i.hp { background: linear-gradient(180deg, #ff8a7a, #c42a2a); }
.hcard.lowhp .bar { box-shadow: 0 0 0 2px #000, 0 0 8px rgba(255,74,74,.6); }
.hcard .ubar { height: 3px; margin: 2px 0 5px; background: #120d18; box-shadow: 0 0 0 1px #000; position: relative; }
.hcard .ubar i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, #b07a10, #ffd34a); transition: width .2s; }
.hcard.ultready .ubar i { background: #fff2a8; box-shadow: 0 0 6px #ffd34a; }
.hcard .hc-down { display: none; position: absolute; inset: 0; align-items: center; justify-content: center; font-family: var(--font2); font-size: 16px; letter-spacing: 2px; color: #ff6a5a; background: rgba(20,6,10,.55); text-shadow: 0 2px 0 #000; pointer-events: none; }
.hcard.down { filter: grayscale(.7) brightness(.8); }
.hcard.down .hc-down { display: flex; }
.skills { display: flex; gap: 5px; align-items: center; }
.sk { width: 32px; height: 32px; background: linear-gradient(180deg, #33264a, #1e1630); position: relative; box-shadow: 0 0 0 1px #000, inset 0 0 0 1px #4a3a64; overflow: hidden; font-family: var(--font2); display: flex; align-items: center; justify-content: center; }
.sk .ic { display: flex; transition: opacity .15s; }
.sk .ic img { width: 24px; height: 24px; image-rendering: pixelated; display: block; }
.sk.cool .ic { opacity: .45; filter: grayscale(.6); }
.sk .cdf { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(8,4,14,.6); pointer-events: none; }
.sk .cdn { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; color: #fff; text-shadow: 1px 0 0 #000, -1px 0 0 #000, 0 1px 0 #000, 0 -1px 0 #000; pointer-events: none; }
.sk .k { position: absolute; right: 0; bottom: 0; color: var(--gold); font-size: 8px; line-height: 1; padding: 1px 2px; background: rgba(8,4,14,.8); }
.sk .k .g-btn, .sk .k .g-key { font-size: 8px; padding: 0 2px; }
.sk.ult { width: 36px; height: 36px; box-shadow: 0 0 0 1px #000, inset 0 0 0 1px #8a6a1a; }
.sk.ult .cdf { background: rgba(8,4,14,.65); }
.sk.ult .cdn { font-size: 10px; color: #ffd34a; align-items: flex-start; padding-top: 2px; }
.sk.ult.ready { box-shadow: 0 0 0 1px #000, inset 0 0 0 2px #ffd34a, 0 0 10px #ffd34a; animation: pulse .8s infinite alternate; }
@keyframes pulse { to { background: #6a4a10; } }
#banner { position: absolute; top: 28%; left: 0; right: 0; text-align: center; font-size: clamp(30px, calc(5 * var(--vw, 1vw)), 64px); font-weight: 700; color: #ffe9b0;
  text-shadow: 0 4px 0 #6a2a0a, 0 0 30px rgba(255,140,60,.6); opacity: 0; transition: opacity .3s, transform .3s; transform: scale(.9); }
#banner.show { opacity: 1; transform: scale(1); }
#banner small { display: block; font-size: .4em; color: #d8c8ff; text-shadow: 0 2px 0 #000; margin-top: 6px; }
#toast { position: absolute; bottom: 150px; left: 50%; transform: translateX(-50%); font-size: 18px; background: rgba(0,0,0,.7); padding: 6px 14px; opacity: 0; transition: opacity .3s; }
#toast.show { opacity: 1; }

/* ---------- level up ---------- */
#levelups { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap; padding: 70px 20px 140px; }
#levelups.active { background: rgba(8,4,16,.55); }
.lv-panel { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.lv-title { font-size: 20px; text-shadow: 0 2px 0 #000; }
.lv-title b { color: var(--pc); }
.lv-cards { display: flex; gap: 10px; }
/* level-up power card: big icon, name, one clear effect line, and a simple stack footer */
.card { width: clamp(190px, calc(21 * var(--vw, 1vw)), 250px); min-height: 330px; padding: 16px 14px 12px; cursor: pointer; text-align: center; position: relative;
  background: linear-gradient(180deg, #2c2140 0%, #191122 70%); box-shadow: 0 0 0 2px #000, 0 0 0 4px var(--rc), 0 10px 30px rgba(0,0,0,.5);
  transition: transform .08s; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.card:hover, .card.sel { transform: translateY(-10px); box-shadow: 0 0 0 2px #000, 0 0 0 4px var(--rc), 0 0 30px var(--rc); }
.card .rr { font-size: 13px; color: var(--rc); font-family: var(--font2); letter-spacing: 2px; text-transform: uppercase; }
.card .ico { font-size: 54px; line-height: 1; margin: 2px 0; filter: drop-shadow(0 3px 0 #000); }
.card .nn { font-size: 26px; font-weight: 700; line-height: 1.05; }
.card .tt { font-size: 18px; color: #f0e8ff; line-height: 1.3; }
.card .tag { font-size: 12px; color: var(--gold); font-family: var(--font2); }
.card .tag.tree { color: var(--legendary); }
.card .badge { position: absolute; top: -10px; right: -10px; background: #120d18; color: var(--gold); font-family: var(--font2); font-size: 13px; padding: 3px 7px; box-shadow: 0 0 0 2px #000, 0 0 0 3px var(--gold); }
.card .badge.new { color: #0b0812; background: #9ad8ff; box-shadow: 0 0 0 2px #000; }
.card .foot { margin-top: auto; width: 100%; padding-top: 10px; border-top: 2px solid rgba(255,255,255,.08); display: flex; flex-direction: column; gap: 6px; align-items: center; }
.card .pips { display: flex; gap: 5px; }
.card .pips i { width: 16px; height: 8px; background: #2a2038; box-shadow: 0 0 0 1px #000; }
.card .pips i.have { background: var(--rc); }
.card .pips i.next { background: #fff; box-shadow: 0 0 0 1px #000, 0 0 8px #fff; animation: pipnext .7s ease-in-out infinite alternate; }
@keyframes pipnext { to { background: var(--rc); } }
.card .gain { font-size: 22px; font-weight: 700; }
.card .gain span { color: var(--muted); }
.card .gain b { color: var(--green); }
.card .maxed { font-size: 12px; color: var(--legendary); font-family: var(--font2); }
.card .key kbd { font-size: 14px; padding: 2px 8px; }
.lv-title { font-size: 26px; }
.lv-panel.compact .card { width: 168px; min-height: 270px; padding: 12px 10px 10px; }
.lv-panel.compact .card .ico { font-size: 38px; }
.lv-panel.compact .card .nn { font-size: 19px; }
.lv-panel.compact .card .tt { font-size: 14px; }
.lv-panel.compact .card .gain { font-size: 17px; }
.lv-panel.compact .lv-title { font-size: 18px; }
.waiting { font-size: 16px; color: var(--muted); }

/* ---------- armory ---------- */
.armory { width: min(1180px, calc(96 * var(--vw, 1vw))); height: min(720px, calc(92 * var(--vh, 1vh))); display: grid; grid-template-columns: 300px 1fr 330px; gap: 16px; }
.arm-col { overflow: auto; }
.tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.tab { flex: 1; text-align: center; padding: 2px 0; cursor: pointer; border: 4px solid transparent; border-image: var(--pf-tab) 3 fill / 4px stretch; font-size: 14px; color: #cfc4df; }
.tab:hover { color: #fff; }
.tab.on { border-image-source: var(--pf-tab-on); color: var(--gold); text-shadow: 0 2px 0 #000; }
.eqslot { display: flex; gap: 8px; align-items: center; padding: 6px; margin-bottom: 6px; background: #120d1c; box-shadow: 0 0 0 2px #000; cursor: pointer; min-height: 48px; }
.eqslot .sl { font-size: 11px; color: var(--muted); width: 56px; }
.eqslot.on { box-shadow: 0 0 0 2px var(--gold); }
.stash { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; }
.icell { aspect-ratio: 1; background: #120d1c; box-shadow: 0 0 0 2px #000, inset 0 0 0 2px var(--gc); position: relative; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.icell canvas { position: static; width: 44px; height: 44px; image-rendering: pixelated; }
.icell .lv { position: absolute; right: 3px; bottom: 1px; font-size: 11px; color: var(--gold); font-family: var(--font2); }
.icell .eq { position: absolute; left: 3px; top: 1px; font-size: 10px; color: var(--green); font-family: var(--font2); }
.icell.sel { box-shadow: 0 0 0 2px #fff, inset 0 0 0 2px var(--gc), 0 0 14px var(--gc); }
.icell.new::after { content: 'NEW'; position: absolute; top: -6px; right: -6px; font-size: 9px; background: var(--red); padding: 0 3px; font-family: var(--font2); }
.idetail .iname { font-size: 20px; font-weight: 700; color: var(--gc); }
.idetail .igrade { font-size: 12px; color: var(--gc); font-family: var(--font2); }
.idetail .stat { font-size: 15px; }
.idetail .stat.base { color: #fff; }
.idetail .stat.aff { color: #9ad8ff; }
.idetail .power { color: var(--legendary); font-size: 14px; margin-top: 6px; }
.statsum { font-size: 13px; line-height: 1.5; color: #cfc4df; columns: 2; }
.res { font-size: 18px; }
.filters { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 8px; }
.filters .tab { flex: none; padding: 0 6px; font-size: 13px; }

/* ---------- results ---------- */
.results { width: min(900px, calc(94 * var(--vw, 1vw))); text-align: center; }
.results h1 { font-size: 54px; }
.results .win { color: #ffe9b0; text-shadow: 0 4px 0 #8a5a0a; }
.results .lose { color: #ff8a8a; text-shadow: 0 4px 0 #4a0a0a; }
.res-table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 16px; }
.res-table td, .res-table th { padding: 4px 8px; text-align: center; }
.res-table th { color: var(--muted); font-weight: 400; font-size: 13px; }
.loot { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 10px 0; }
.loot .icell { width: 70px; animation: drop .5s backwards; }
@keyframes drop { from { transform: translateY(-30px) scale(.5); opacity: 0; } }
.help { font-size: 14px; line-height: 1.6; color: #d8cee6; }
.help td { padding: 2px 10px; }

/* ---------- feedback modal ---------- */
.fb-modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; background: rgba(8,4,16,.72); }
.fb-box { width: min(560px, calc(94 * var(--vw, 1vw))); }
.fb-cats { display: flex; gap: 6px; }
.fb-cats .tab { font-family: var(--font); color: var(--text); border: none; font-size: 15px; padding: 8px 0; }
.fb-stars { display: flex; gap: 2px; margin-left: auto; }
.fb-star { background: none; border: none; font-size: 26px; color: #3b2d52; cursor: pointer; padding: 0 2px; text-shadow: 0 2px 0 #000; }
.fb-star.on { color: var(--gold); }
.fb-box textarea { width: 100%; min-height: 130px; resize: vertical; font-family: var(--font); font-size: 16px; background: #0b0812; color: var(--text); border: none; box-shadow: 0 0 0 2px var(--edge2); padding: 10px; outline: none; }
.fb-box textarea:focus, .fb-box input[type=text]:focus { box-shadow: 0 0 0 2px var(--gold); }
.fb-ctx { display: block; font-size: 13px; margin-top: 10px; cursor: pointer; }
.hud-gear { pointer-events: auto; cursor: pointer; font-size: 22px; line-height: 1; width: 36px; height: 34px; margin-bottom: 4px;
  font-family: var(--font); color: var(--text); background: rgba(15,10,24,.82); border: none; box-shadow: 0 0 0 2px #000, 0 0 0 3px var(--edge); }
.hud-gear:hover { color: var(--gold); box-shadow: 0 0 0 2px #000, 0 0 0 3px var(--gold); }
/* level-up arming: cards wait a moment so attack clicks can't pick one by accident */
.lv-cards.locked .card { filter: grayscale(.6) brightness(.6); cursor: progress; transform: none !important; }
.lv-arm { width: 220px; height: 4px; background: #120d18; box-shadow: 0 0 0 1px #000; overflow: hidden; }
.lv-arm i { display: block; height: 100%; width: 0; background: var(--gold); animation-name: arm; animation-timing-function: linear; animation-fill-mode: forwards; }
.lv-arm.done { visibility: hidden; }
@keyframes arm { to { width: 100%; } }

/* team XP bar above the hero cards */
.hud-xp { position: absolute; bottom: 110px; left: 50%; transform: translateX(-50%); width: min(880px, calc(92 * var(--vw, 1vw))); display: flex; align-items: center; gap: 10px; text-shadow: 0 2px 0 #000; }
.xp-lv { font-size: 16px; white-space: nowrap; }
.xp-lv.next { color: var(--muted); }
.xp-bar { flex: 1; height: 16px; background: #120d18; box-shadow: 0 0 0 2px #000, 0 0 0 3px #3b2d52; position: relative; overflow: hidden; }
.xp-bar i { position: absolute; left: 0; top: 0; bottom: 0; transition: width .25s; }
.xp-fill { background: linear-gradient(180deg, #b8ffe6, #2ac88a 60%, #1a8a5e); }
.xp-ghost { background: repeating-linear-gradient(90deg, rgba(110,255,208,.35) 0 4px, rgba(110,255,208,.15) 4px 8px); }
.xp-ticks { position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 1px), rgba(0,0,0,.45) calc(10% - 1px) 10%); }
.xp-text { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; font-family: var(--font2); color: #fff; }
.hud-xp.soon .xp-lv.next { color: var(--gold); }
.hud-xp.soon .xp-bar { box-shadow: 0 0 0 2px #000, 0 0 0 3px var(--gold), 0 0 14px rgba(255,211,74,.6); animation: xpglow .7s ease-in-out infinite alternate; }
.hud-xp.soon .xp-text { color: #fff2b0; }
@keyframes xpglow { to { box-shadow: 0 0 0 2px #000, 0 0 0 3px var(--gold), 0 0 26px rgba(255,211,74,.9); } }
.hud-xp.ding .xp-bar { animation: xpding .6s ease-out; }
@keyframes xpding { 0% { background: #fff8c0; } 100% { background: #120d18; } }

/* ---------- hero stats sheet ---------- */
.hs-box { width: min(1060px, calc(96 * var(--vw, 1vw))); max-height: calc(92 * var(--vh, 1vh)); display: flex; flex-direction: column; gap: 10px; }
.hs-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.hs-tabs .tab { flex: none; padding: 6px 12px; font-family: var(--font); color: var(--text); border: none; font-size: 15px; cursor: pointer; }
.hs-tabs .tab.on { color: var(--gold); }
.hs-tabs .hs-close { margin-left: auto; }
.hs-head { display: flex; gap: 14px; align-items: center; }
.hs-port canvas { background: radial-gradient(circle, #2a2040, #120d1c); box-shadow: 0 0 0 2px #000, 0 0 0 3px var(--hc); image-rendering: pixelated; }
.hs-note { font-size: 13px; color: var(--gold); margin-top: 2px; }
.hs-run { display: flex; gap: 8px; }
.hs-run > div { flex: 1; background: #120d1c; box-shadow: 0 0 0 2px #000; text-align: center; padding: 6px 4px; }
.hs-run b { display: block; font-size: 20px; }
.hs-run span { font-size: 12px; color: var(--muted); }
.hs-body { display: grid; grid-template-columns: 1fr 1.35fr 1fr; gap: 18px; overflow: auto; min-height: 0; }
.hs-col h3 { font-size: 17px; border-bottom: 2px solid #3b2d52; padding-bottom: 4px; }
.hs-row { display: flex; justify-content: space-between; font-size: 15px; padding: 2px 0; border-bottom: 1px dashed rgba(92,70,128,.35); }
.hs-row.up b { color: var(--green); }
.hs-row.down b { color: var(--red); }
.hs-legend { font-size: 12px; margin-top: 6px; }
.hs-legend .up { color: var(--green); }
.hs-ab { display: grid; grid-template-columns: 30px 1fr; gap: 8px; margin-bottom: 10px; }
.hs-ic { font-size: 20px; text-align: center; }
.hs-abn { font-size: 15px; display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.hs-abn .muted { font-size: 12px; }
.hs-cd { margin-left: auto; font-family: var(--font2); font-size: 11px; color: var(--gold); }
.hs-abt { font-size: 13px; color: #d8cee6; line-height: 1.3; }
.hs-ab.passive .hs-abt { color: #c590ff; }
.hs-pows { display: flex; flex-direction: column; gap: 5px; }
.hs-pow { display: flex; gap: 8px; align-items: center; font-size: 14px; background: #120d1c; box-shadow: 0 0 0 1px #000, inset 3px 0 0 var(--rc); padding: 4px 8px; }
.hs-pow b { margin-left: auto; color: var(--gold); }
.hs-pi { width: 20px; text-align: center; }
.hs-foot { font-size: 12px; text-align: right; }
.hcard { pointer-events: auto; cursor: pointer; }
.hcard:hover { filter: brightness(1.15); }
@media (max-width: 760px) { html:not(.zoomed) .hs-body { grid-template-columns: 1fr; } }
/* gamepad / keyboard focus for non-button menu items */
[data-nav].sel:not(.btn) { outline: 2px solid var(--gold); outline-offset: 2px; }
input[type=range].sel { outline: 2px solid var(--gold); outline-offset: 4px; }
/* loot crate counter */
.h-crates { display: flex; gap: 3px; align-items: center; justify-content: flex-end; flex-wrap: wrap; max-width: 180px; margin-left: auto; }
.h-crates b { margin-right: 4px; }
.h-crates .pip { display: inline-block; width: 7px; height: 7px; box-shadow: 0 0 0 1px #000; }
.h-crates.pop { animation: cratepop .5s ease-out; }
@keyframes cratepop { 0% { transform: scale(1.5); color: var(--gold); } 100% { transform: scale(1); } }

/* power bar (left edge) */
.hud-powers { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 10px; }
.pw-panel { pointer-events: auto; background: rgba(15,10,24,.72); box-shadow: 0 0 0 2px #000, 0 0 0 3px var(--edge); padding: 6px; width: 118px; }
.pw-head { font-size: 13px; margin-bottom: 5px; text-shadow: 0 1px 0 #000; }
.pw-head b { color: var(--pc); }
.pw-head span { float: right; color: var(--muted); }
.pw-grid { display: grid; grid-template-columns: repeat(3, 32px); gap: 5px; }
.pw-empty { grid-column: 1 / -1; font-size: 12px; color: var(--muted); line-height: 1.3; }
.pw { width: 32px; height: 32px; background: #120d1c; box-shadow: 0 0 0 1px #000, inset 0 0 0 2px var(--rc); display: flex; align-items: center; justify-content: center; position: relative; font-size: 17px; cursor: help; }
.pw b { position: absolute; right: 1px; bottom: -2px; font-size: 11px; font-family: var(--font2); color: #fff; text-shadow: 0 1px 0 #000, 1px 0 0 #000, -1px 0 0 #000, 0 -1px 0 #000; }
.pw.new { animation: pwnew 1.6s ease-out; }
@keyframes pwnew { 0% { transform: scale(1.8); box-shadow: 0 0 0 1px #000, inset 0 0 0 2px var(--rc), 0 0 22px var(--rc); } 60% { box-shadow: 0 0 0 1px #000, inset 0 0 0 2px var(--rc), 0 0 16px var(--rc); } 100% { transform: scale(1); } }
.lv-owned { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; justify-content: center; max-width: 560px; background: rgba(15,10,24,.8); padding: 5px 8px; box-shadow: 0 0 0 2px #000; }
.lv-owned span { font-size: 13px; color: var(--muted); margin-right: 4px; }
.lv-owned .pw { width: 32px; height: 32px; font-size: 17px; }
@media (max-width: 900px) { .pw-panel { width: 82px; } .pw-grid { grid-template-columns: repeat(2, 32px); } }

/* skill tooltip */
#skill-tip { position: fixed; z-index: 30; width: 260px; padding: 10px 12px; background: linear-gradient(180deg, #2a2038, #17101f); box-shadow: 0 0 0 2px #000, 0 0 0 3px var(--edge2), 0 8px 24px rgba(0,0,0,.6); pointer-events: none; opacity: 0; transition: opacity .1s; font-family: var(--font); }
#skill-tip.show { opacity: 1; }
#skill-tip .st-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
#skill-tip .st-head b { font-size: 17px; color: var(--gold); }
#skill-tip .st-head span { font-size: 12px; color: var(--muted); }
#skill-tip .st-desc { font-size: 14px; color: #e4dcef; line-height: 1.3; margin: 6px 0; }
#skill-tip .st-foot { display: flex; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--muted); align-items: center; }
#skill-tip .st-foot .rdy { color: var(--green); }
.sk { cursor: help; }

/* crystal HP bar feedback */
.bar.crystal > i.trail { background: #ffe6b0; transition: width .45s ease-in; }
.bar.crystal.hit { animation: chit .35s ease-out; }
@keyframes chit {
  0% { box-shadow: 0 0 0 2px #000, 0 0 0 4px #ffa53a, 0 0 18px #ffa53a; transform: translateX(-3px); }
  30% { transform: translateX(3px); } 60% { transform: translateX(-2px); }
  100% { box-shadow: 0 0 0 2px #000; transform: none; }
}
.bar.crystal.hit > i.hp { filter: brightness(1.6) saturate(.6); }
.bar.crystal.low > i.hp { background: linear-gradient(180deg, #ff9a8a, #c01a2a); animation: clow 1s ease-in-out infinite alternate; }
.bar.crystal.low { box-shadow: 0 0 0 2px #000, 0 0 0 3px #ff4a4a; }
.bar.crystal.low.hit { animation: chitlow .35s ease-out; }
@keyframes chitlow {
  0% { box-shadow: 0 0 0 2px #000, 0 0 0 4px #ff2a2a, 0 0 22px #ff2a2a; transform: translateX(-3px); }
  30% { transform: translateX(3px); } 60% { transform: translateX(-2px); }
  100% { box-shadow: 0 0 0 2px #000, 0 0 0 3px #ff4a4a; transform: none; }
}
@keyframes clow { to { filter: brightness(1.35); } }
.c-alert { color: #ffa53a; font-weight: 700; opacity: 0; transition: opacity .2s; margin-left: 6px; }
.c-alert.on { opacity: 1; animation: blink 0.6s steps(2) infinite; }
.bar.crystal.low ~ * , .bar-label:has(+ .bar.crystal.low) .c-alert { color: #ff5a5a; }

/* ---------- skill trees ---------- */
.st-wrap { width: min(1180px, calc(97 * var(--vw, 1vw))); max-height: calc(95 * var(--vh, 1vh)); display: flex; flex-direction: column; gap: 10px; overflow: auto; }
.st-badge { background: var(--gold); color: #000; padding: 0 5px; font-size: 12px; }
.st-top { display: flex; gap: 14px; align-items: center; }
.st-port canvas { background: radial-gradient(circle, #2a2040, #120d1c); box-shadow: 0 0 0 2px #000, 0 0 0 3px var(--edge2); }
.st-hero { flex: 1; }
.st-xp { position: relative; height: 16px; background: #120d18; box-shadow: 0 0 0 2px #000; margin-top: 6px; }
.st-xp i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(180deg, #ffe9a0, #c89a2a); }
.st-xp span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; font-family: var(--font2); text-shadow: 0 1px 0 #000; }
.st-pts { text-align: right; font-size: 15px; }
.st-pts b { font-size: 26px; }
.st-pts.has b { color: var(--gold); text-shadow: 0 0 12px rgba(255,211,74,.7); }
.st-pts .muted { font-size: 12px; }
.st-body { display: grid; grid-template-columns: 1fr 300px; gap: 14px; min-height: 0; }
.st-branches { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.st-branch { background: rgba(0,0,0,.25); box-shadow: inset 0 0 0 1px rgba(255,255,255,.05); padding: 8px; display: flex; flex-direction: column; align-items: stretch; }
.st-bhead { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; border-bottom: 2px solid var(--bc); padding-bottom: 6px; }
.st-bhead b { color: var(--bc); font-size: 17px; }
.st-bhead .muted { font-size: 12px; }
.st-bicon { font-size: 22px; }
.st-bpts { margin-left: auto; font-family: var(--font2); font-size: 12px; color: var(--muted); }
.st-link { width: 4px; height: 14px; margin: 0 auto; background: #2a2038; }
.st-link.on { background: var(--bc); box-shadow: 0 0 6px var(--bc); }
.st-node { display: grid; grid-template-columns: 34px 1fr; grid-template-rows: auto auto; gap: 2px 8px; padding: 7px 8px; cursor: pointer; background: #17101f; box-shadow: 0 0 0 2px #000, 0 0 0 3px #2a2038; transition: transform .06s; }
.st-node:hover { transform: translateY(-2px); }
.st-node .st-ic { grid-row: span 2; font-size: 22px; display: flex; align-items: center; justify-content: center; }
.st-name { font-size: 14px; font-weight: 700; }
.st-kind { font-size: 11px; color: var(--muted); font-family: var(--font2); }
.st-pips { grid-column: 2; display: flex; gap: 3px; }
.st-pips i { width: 10px; height: 5px; background: #2a2038; box-shadow: 0 0 0 1px #000; }
.st-pips i.on { background: var(--bc); }
.st-node.locked { opacity: .45; filter: grayscale(.7); }
.st-node.avail { box-shadow: 0 0 0 2px #000, 0 0 0 3px var(--gold); animation: stavail 1.2s ease-in-out infinite alternate; }
@keyframes stavail { to { box-shadow: 0 0 0 2px #000, 0 0 0 3px var(--gold), 0 0 14px rgba(255,211,74,.55); } }
.st-node.learned, .st-node.maxed { box-shadow: 0 0 0 2px #000, 0 0 0 3px var(--bc); background: linear-gradient(180deg, #2a2038, #17101f); }
.st-node.maxed .st-name { color: var(--bc); }
.st-node.t2 .st-kind { color: #9ad8ff; }
.st-node.t3 { background: linear-gradient(180deg, #2a1e10, #17101f); }
.st-node.t3 .st-kind { color: var(--legendary); }
.st-node.sel-node { outline: 2px solid #fff; outline-offset: 2px; }
.st-detail { background: rgba(0,0,0,.3); box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); padding: 12px; font-size: 14px; line-height: 1.35; }
.st-dhead { display: flex; gap: 10px; align-items: center; border-bottom: 2px solid var(--bc); padding-bottom: 8px; margin-bottom: 8px; }
.st-ic.big { font-size: 30px; }
.st-dname { font-size: 19px; font-weight: 700; color: var(--bc); }
.st-now, .st-next { margin: 6px 0; }
.st-now span, .st-next span { display: block; font-size: 11px; font-family: var(--font2); color: var(--muted); }
.st-next { color: var(--green); }
.st-power { margin-top: 8px; padding: 6px; background: rgba(255,154,46,.1); box-shadow: inset 0 0 0 1px rgba(255,154,46,.4); font-size: 13px; }
.st-req { margin-top: 8px; color: var(--red); font-size: 13px; }
.card .treetag { font-size: 11px; color: var(--legendary); font-family: var(--font2); }
.slot .herolv { font-size: 12px; color: var(--gold); }
@media (max-width: 980px) { html:not(.zoomed) .st-body { grid-template-columns: 1fr; } }
.hero-gains { margin: 6px 0 10px; }
.hero-gains .hg { font-size: 16px; }
.idetail .stat.neg { color: var(--red); }
.idetail .traits { margin-top: 6px; padding-top: 4px; border-top: 1px solid #3a2f4e; }
.idetail .traits .tr-h { font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: #a99fbb; margin-bottom: 2px; }
.idetail .traits .tr-h span { color: #8a7f9a; }
.idetail .traits .tr-row { color: #e6dcc4; }
.idetail .traits .tr-lock { color: #8a7f9a; font-size: 12px; margin-top: 2px; }
.cmp-tr { font-size: 10px; letter-spacing: 1px; text-transform: uppercase; opacity: .7; margin-right: 3px; }
.idetail .wtype { font-size: 13px; color: #d8cee6; margin: 2px 0 6px; line-height: 1.3; }
.idetail .wtype b { color: var(--gc); }

.card .gain, .card .badge, .card .tt .n, .pw b { font-family: var(--font2); }
.card .gain { font-size: 20px; font-weight: 400; }
.card .tt .n { color: #fff; font-size: .92em; }
.lv-panel.compact .card .gain { font-size: 15px; }

/* ---------- button prompts (keyboard / Xbox / PlayStation) ---------- */
.g { display: inline-flex; align-items: center; gap: 2px; vertical-align: middle; }
.g-sep { color: var(--muted); margin: 0 2px; font-size: .8em; }
kbd.g-key { font-family: var(--font2); font-size: 11px; background: #0b0812; color: var(--gold); border: 1px solid var(--edge2); border-bottom-width: 3px; padding: 1px 6px; border-radius: 3px; }
kbd.g-btn { font-family: var(--font2); font-size: 11px; min-width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; padding: 0 4px; border-radius: 10px; color: #fff; border: none; box-shadow: 0 2px 0 rgba(0,0,0,.6), inset 0 0 0 1px rgba(255,255,255,.25); text-shadow: 0 1px 0 rgba(0,0,0,.5); }
kbd.g-a { background: #3aa84a; } kbd.g-b { background: #d0453a; } kbd.g-x { background: #3a6fd8; } kbd.g-y { background: #d8b02a; }
kbd.g-ps-x { background: #2a3a5a; color: #8fb8ff; font-size: 13px; } kbd.g-ps-o { background: #2a3a5a; color: #ff6a7a; font-size: 13px; }
kbd.g-ps-s { background: #2a3a5a; color: #ff8ad8; font-size: 13px; } kbd.g-ps-t { background: #2a3a5a; color: #6af0b0; font-size: 13px; }
kbd.g-sh { background: #3a3446; border-radius: 4px; min-width: 26px; }
kbd.g-sys { background: #3a3446; border-radius: 4px; }
#hintbar { position: fixed; left: 50%; bottom: 10px; transform: translateX(-50%); display: none; gap: 16px; padding: 7px 14px; z-index: 40;
  background: rgba(11,8,18,.85); box-shadow: 0 0 0 2px #000, 0 0 0 3px var(--edge); font-size: 14px; white-space: nowrap; pointer-events: none; }
#hintbar.show { display: flex; }
#hintbar .hb { display: inline-flex; align-items: center; gap: 6px; }
.press { text-transform: none; }
.screen-full { padding-bottom: 46px; box-sizing: border-box; }
.q-hi { color: var(--green); } .q-lo { color: var(--red); }
/* shoulder-button hints at both ends of tab rows */
.tabs > .g, .filters > .g, .hs-tabs > .g, .row > .g { flex: none; align-self: center; margin: 0 2px; }
.tabs, .filters, .hs-tabs { align-items: center; }
.build { position: fixed; right: 12px; bottom: 8px; font-family: var(--font2); font-size: 11px; color: var(--muted); opacity: .7; }
/* selected item (whose stats are shown) vs keyboard/controller focus (.sel) */
.icell.picked { box-shadow: 0 0 0 2px #000, inset 0 0 0 2px var(--gc), 0 0 0 4px #fff, 0 0 18px var(--gc); background: #2a2038; transform: scale(1.05); z-index: 1; }
.eqslot.picked { box-shadow: 0 0 0 2px #fff; background: #2a2038; }
.icell.sel:not(.picked) { box-shadow: 0 0 0 2px #000, inset 0 0 0 2px var(--gc), 0 0 0 3px var(--gold); }

/* ---------- Heroes hub: one screen for equipment, skill tree and stats ---------- */
.hub { width: min(var(--hubmax, 1200px), calc(97 * var(--vw, 1vw))); display: flex; flex-direction: column; gap: 10px; max-height: calc(94 * var(--vh, 1vh)); }
.hub-head { display: flex; flex-direction: column; gap: 6px; }
.hub-heroes .tab { font-size: 18px; padding: 4px 0; }
.hub-heroes .tab.on { box-shadow: inset 0 -3px 0 var(--hc); color: var(--hc); }
.hub-secs .tab { font-size: 16px; padding: 3px 0; }
.hub-secs .hub-back { flex: 0 0 auto; padding: 3px 16px; color: var(--gold); }   /* the way out of the hub, always visible */
.hub-secs .tab.on { color: var(--gold); box-shadow: inset 0 -3px 0 var(--gold); }
.hub .armory { width: 100%; height: min(640px, calc(calc(94 * var(--vh, 1vh)) - 110px)); }
.hub .st-wrap { width: 100%; max-height: calc(calc(94 * var(--vh, 1vh)) - 110px); }
.hub-panel { max-height: calc(calc(94 * var(--vh, 1vh)) - 110px); overflow: auto; display: flex; flex-direction: column; gap: 10px; }
.hub-stats { grid-template-columns: 1.6fr 1fr; }
.hub-stats .hs-groups { grid-template-columns: 1fr 1fr; }

/* item actions */
.acts { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.acts-h { font-size: 11px; font-family: var(--font2); color: var(--muted, #9a8fb0); letter-spacing: 1px; margin: 6px 0 -2px; text-transform: uppercase; }
.act { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 7px 10px; font: inherit; color: #fff; cursor: pointer;
  background: #241b33; border: 0; box-shadow: 0 0 0 2px #000, inset 0 0 0 1px #3a2c52; border-left: 4px solid var(--ac, #5c4680); transition: background .1s, transform .1s; }
.act .ai { font-size: 18px; text-align: center; }
.act .at b { display: block; font-size: 15px; }
.act .at small { display: block; font-size: 12px; color: #b8aecb; margin-top: 1px; }
.act .ac { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-style: normal; }
.act .ac i { font-style: normal; font-size: 14px; padding: 1px 6px; background: #120d1c; box-shadow: 0 0 0 1px #000; white-space: nowrap; }
.act .ac i.gold { color: var(--gold); } .act .ac i.shard { color: #9ad8ff; }
.act .ac i.short { color: var(--red); text-decoration: line-through; }
.act .g { justify-self: end; }
.act:hover:not(:disabled), .act.sel { background: #33264a; transform: translateX(3px); box-shadow: 0 0 0 2px var(--gold), inset 0 0 0 1px #5c4680; }
.act.sel::before { content: none; }
.act:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.act.eqb { --ac: var(--green); } .act.eqb.off { --ac: #8a7aa0; }
.act.eqb .at b { font-size: 17px; }
.act.up { --ac: var(--gold); } .act.rf { --ac: #9ad8ff; } .act.sv { --ac: var(--red); }
.act.sv .at b { color: #ffb0a8; }
.act.sv.confirm { background: #5a1a1a; animation: pulse-red .8s infinite alternate; }
@keyframes pulse-red { to { background: #7a2424; } }
.icell .eq.other { color: inherit; }

/* grouped stats */
.hs-groups { display: grid; grid-template-columns: 1fr; gap: 10px; align-items: start; }
.hs-grp { background: rgba(18,13,28,.55); box-shadow: 0 0 0 1px #000, inset 0 0 0 1px #3a2c52; border-top: 3px solid var(--grc, #5c4680); padding: 6px 10px 6px; }
.hs-gh { font-size: 13px; font-family: var(--font2); letter-spacing: 1px; text-transform: uppercase; color: var(--grc); margin-bottom: 3px; display: flex; gap: 6px; align-items: center; }
.hs-grp .hs-row:last-child { border-bottom: 0; }
.hs-off { --grc: #ff8a5a; } .hs-def { --grc: #7ad0ff; } .hs-fx { --grc: #c89aff; } .hs-util { --grc: #ffd34a; } .hs-build { --grc: #6ae0c8; }
.hs-legend .down { color: var(--red); margin-left: 8px; }
.hs-tip { font-size: 13px; line-height: 1.4; margin-top: 12px; }

.hs-wide { grid-template-columns: 1.55fr 1fr; }
.hs-wide .hs-groups { grid-template-columns: 1fr 1fr; }
@media (max-width: 760px) { html:not(.zoomed) :is(.hs-wide, .hub-stats, .hs-wide .hs-groups, .hub-stats .hs-groups) { grid-template-columns: 1fr; } }

.hs-ic img { width: 24px; height: 24px; image-rendering: pixelated; display: block; }

/* account */
.acc-box { width: min(460px, calc(94 * var(--vw, 1vw))); display: flex; flex-direction: column; gap: 10px; }
.acc-box h2 { margin: 0; }
.acc-box p { margin: 0; font-size: 14px; line-height: 1.4; }
.acc-tabs { display: flex; gap: 4px; }
.acc-tabs .tab { flex: 1; text-align: center; }
.acc-form { display: flex; flex-direction: column; gap: 8px; }
.acc-f { display: flex; flex-direction: column; gap: 3px; font-size: 13px; color: #b8aecb; }
.acc-f input, .acc-f input[type="text"] { width: 100%; box-sizing: border-box; font: inherit; font-size: 16px; padding: 8px 10px; background: #120d1c; color: #fff; border: 0; box-shadow: 0 0 0 2px #000, inset 0 0 0 1px #4a3a64; }
.acc-f input:focus, .acc-f input.sel { outline: none; box-shadow: 0 0 0 2px #000, inset 0 0 0 2px var(--gold); }
.acc-msg { min-height: 18px; font-size: 14px; color: var(--red); }
.acc-msg.ok { color: var(--green); }
.acc-note { font-size: 12px !important; }
.acc-code { font-family: var(--font2); font-size: 28px; letter-spacing: 3px; text-align: center; padding: 14px; background: #120d1c; color: var(--gold); box-shadow: 0 0 0 2px #000, inset 0 0 0 1px #8a6a1a; user-select: all; }
.acc-sync { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px; background: #120d1c; box-shadow: 0 0 0 1px #000; font-size: 14px; }
.acc-sync.synced b { color: var(--green); } .acc-sync.offline b { color: var(--red); } .acc-sync.pending b, .acc-sync.saving b { color: var(--gold); }
.acc-row { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; padding: 6px 0; border-top: 1px dashed rgba(92,70,128,.4); border-bottom: 1px dashed rgba(92,70,128,.4); }
.acc-pw { display: flex; flex-direction: column; gap: 8px; }

/* level-up timer + skill-linked cards */
.lv-timer { width: min(420px, calc(80 * var(--vw, 1vw))); height: 20px; margin: 2px 0 18px; position: relative; background: #120d18; box-shadow: 0 0 0 2px #000; overflow: hidden; }
.lv-timer i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(180deg, #8a7aa0, #4a3a64); transition: width .1s linear; }
.lv-timer span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 14px; color: #fff; text-shadow: 0 1px 0 #000; }
.lv-timer.low i { background: linear-gradient(180deg, #ff8a7a, #b02a2a); }
.lv-timer.low span { color: #ffe0dc; animation: lvblink .5s infinite alternate; }
@keyframes lvblink { to { opacity: .55; } }
.card .ico-sk { display: inline-flex; padding: 5px; background: radial-gradient(circle, rgba(255,255,255,.12), transparent 70%); }
.card .ico-sk img { width: 48px; height: 48px; image-rendering: pixelated; display: block; }
.lv-panel.compact .card .ico-sk img { width: 36px; height: 36px; }
.card .tag.skl { color: #9ad8ff; }
/* powers panel (list) */
.hud-powers .pw-panel { width: 168px; padding: 6px 6px 7px; }
.pw-list { display: flex; flex-direction: column; gap: 3px; max-height: calc(46 * var(--vh, 1vh)); overflow-y: auto; scrollbar-width: thin; }
.hud-powers.multi .pw-list { max-height: calc(22 * var(--vh, 1vh)); }
.pw-row { display: flex; align-items: center; gap: 6px; padding: 2px 5px 2px 2px; background: rgba(18,13,28,.85); box-shadow: inset 2px 0 0 var(--rc); cursor: help; pointer-events: auto; min-height: 24px; }
.pw-row:hover { background: #2e2244; }
.pw-row .pw-ic { width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; flex: none; }
.pw-row .pw-ic img { width: 20px; height: 20px; image-rendering: pixelated; }
.pw-row .pe { font-size: 14px; }
.pw-row .pw-nm { flex: 1; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--rc); }
.pw-row b { font-size: 11px; font-family: var(--font2); color: #fff; }
.pw-row.new { animation: pwrow 1.6s ease-out; }
@keyframes pwrow { 0% { background: var(--rc); } 100% { background: rgba(18,13,28,.85); } }
#pw-tip { position: fixed; z-index: 50; width: 240px; padding: 8px 10px; background: rgba(15,10,24,.96); box-shadow: 0 0 0 2px #000, 0 0 0 3px var(--rc, #5c4680); pointer-events: none; opacity: 0; transition: opacity .1s; }
#pw-tip.show { opacity: 1; }
#pw-tip .pt-head { display: flex; gap: 8px; align-items: center; margin-bottom: 5px; }
#pw-tip .pt-ic { width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; font-size: 22px; background: #120d1c; box-shadow: 0 0 0 1px #000, inset 0 0 0 1px var(--rc); }
#pw-tip .pt-ic img { width: 28px; height: 28px; image-rendering: pixelated; }
#pw-tip b { font-size: 15px; color: var(--rc); }
#pw-tip .pt-r { font-size: 11px; color: #9a8fb0; }
#pw-tip .pt-desc { font-size: 13px; line-height: 1.35; }
#pw-tip .pt-desc .n { color: var(--gold); }
#pw-tip .pt-foot { font-size: 11px; color: #9a8fb0; margin-top: 5px; font-family: var(--font2); }
@media (max-width: 900px) { .hud-powers .pw-panel { width: 130px; } }
.pw img { width: 22px; height: 22px; image-rendering: pixelated; display: block; }

/* crystal surge + objective tracker */
.surge { position: relative; height: 12px; margin-top: 4px; background: #120d18; box-shadow: 0 0 0 2px #000; overflow: hidden; }
.surge i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(180deg, #7ad8ff, #2a6aff); transition: width .3s; }
.surge span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 10px; color: #e8f8ff; text-shadow: 0 1px 0 #000, 1px 0 0 #000, -1px 0 0 #000; gap: 3px; }
.surge span .g-key, .surge span .g-btn { font-size: 9px; padding: 0 3px; }
.surge.ready { box-shadow: 0 0 0 2px #000, 0 0 10px #ffd34a; }
.surge.ready i { background: linear-gradient(180deg, #fff2a8, #ffb03a); animation: surgeglow .7s ease-in-out infinite alternate; }
.surge.ready span { color: #2a1a06; text-shadow: none; font-weight: bold; }
@keyframes surgeglow { to { filter: brightness(1.25); } }
.hud-obj { margin-top: 6px; display: inline-block; padding: 4px 10px; font-size: 13px; background: rgba(15,10,24,.85); box-shadow: 0 0 0 2px #000, 0 0 0 3px #6a4a9a; text-shadow: 0 1px 0 #000; }
.hud-obj b { color: #e0c8ff; }
.hud-obj .ic { color: #c890ff; }
.hud-rules { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 3px; justify-content: center; pointer-events: auto; }
.hud-rules span { min-width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; background: rgba(15,10,24,.85); box-shadow: 0 0 0 1px #000, 0 0 0 2px #5a3a7a; color: #e0c8ff; cursor: help; }
.hud-rules .tier { padding: 0 5px; color: #ffd34a; box-shadow: 0 0 0 1px #000, 0 0 0 2px #8a6a2a; font-weight: bold; }
.hud-rules .curse { color: #ff9ad0; box-shadow: 0 0 0 1px #000, 0 0 0 2px #8a2a5a; }
.hud-rules .pact { color: #c590ff; box-shadow: 0 0 0 1px #000, 0 0 0 2px #c590ff; }
.hud-pact { margin-top: 8px; width: min(560px, calc(92 * var(--vw, 1vw))); padding: 10px 12px 10px; background: linear-gradient(#22103a, #140a22); box-shadow: 0 0 0 2px #000, 0 0 0 4px #7a3aff, 0 0 24px #7a3aff88; text-shadow: 0 1px 0 #000; pointer-events: auto; animation: pact-in .35s ease-out 2.3s both; }   /* after the WAVE CLEARED banner */
@keyframes pact-in { from { transform: translateY(-10px) scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
.hud-pact .pc-head { font-size: 15px; letter-spacing: 2px; color: #e0c8ff; text-align: center; margin-bottom: 8px; }
.hud-pact .pc-cols { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: stretch; }
.hud-pact .pc-side { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; padding: 8px 6px; background: rgba(0,0,0,.35); }
.hud-pact .pc-side.curse { box-shadow: inset 0 0 0 2px #8a2a5a; } .hud-pact .pc-side.reward { box-shadow: inset 0 0 0 2px #8a6a2a; }
.hud-pact .pc-lab { font-size: 11px; letter-spacing: 1.5px; color: #a99fbb; }
.hud-pact .pc-ic { font-size: 26px; line-height: 1.1; } .hud-pact .curse .pc-ic, .hud-pact .curse b { color: #ff9ad0; } .hud-pact .reward .pc-ic, .hud-pact .reward b { color: #ffd34a; }
.hud-pact .pc-side small { font-size: 12px; line-height: 1.3; color: #d8cfe6; }
.hud-pact .pc-mid { align-self: center; font-size: 20px; color: #c590ff; }
.hud-pact .pc-dur { margin-top: 8px; font-size: 12px; color: #a99fbb; text-align: center; }
.hud-pact .pc-how { margin-top: 6px; font-size: 13px; text-align: center; color: #fff; }
.hud-pact .pc-how b { color: #e0c8ff; } .hud-pact .pc-seal { color: #fff !important; }
.hud-pact .pc-bar { margin-top: 6px; height: 6px; background: #120d18; box-shadow: 0 0 0 1px #000; } .hud-pact .pc-bar i { display: block; height: 100%; background: linear-gradient(90deg, #7a3aff, #f0d0ff); transition: width .1s linear; }
.hud-pact .pc-chips { margin-top: 6px; display: flex; gap: 6px; justify-content: center; } .hud-pact .pc-p { font-size: 12px; padding: 1px 6px; color: #8a7f9a; box-shadow: 0 0 0 1px #3a2a4a; } .hud-pact .pc-p.on { color: #000; background: var(--c); box-shadow: 0 0 0 1px #000; }
.hud-pactchip { margin-top: 4px; display: inline-block; padding: 2px 8px; font-size: 12px; background: rgba(26,10,46,.9); box-shadow: 0 0 0 1px #000, 0 0 0 2px #c590ff; pointer-events: auto; cursor: help; }
.hud-pactchip b { color: #e0c8ff; }
.hud-obj .emp { color: #ff8ac8; }
.hud-obj.done { box-shadow: 0 0 0 2px #000, 0 0 0 3px #3aa84a; }
.hud-obj .ok { color: #7aff9a; }

/* smart stash */
.stash-tools { display: flex; gap: 6px; margin: 2px 0 6px; flex-wrap: wrap; }
.stash-tools .btn.small { font-size: 13px; padding: 0 5px; }
.icell .cmp { position: absolute; left: 3px; bottom: 0; font-size: 11px; line-height: 1; text-shadow: 0 1px 0 #000, 1px 0 0 #000, -1px 0 0 #000; }
.icell .cmp.up { color: #5aef6a; }
.icell .cmp.down { color: #ff5a5a; opacity: .85; }
.icell .lk { position: absolute; right: 2px; top: 1px; font-size: 9px; line-height: 1; }
.cmpbox { margin-top: 8px; padding: 6px 8px; background: #120d1c; box-shadow: 0 0 0 1px #000, inset 0 0 0 1px #3a2c52; font-size: 13px; }
.cmpbox .cmp-h { font-size: 12px; color: #b8aecb; margin-bottom: 3px; display: flex; justify-content: space-between; gap: 6px; }
.cmpbox b.up, .cmp-row.up { color: #5aef6a; }
.cmpbox b.down, .cmp-row.down { color: #ff6a5a; }
.act.lock { --ac: #c8b8d8; } .act.lock.on { --ac: var(--gold); }
.cmp-row.lost { text-decoration: line-through; opacity: .8; }

/* forge */
.forge-link { margin-top: 12px; align-self: flex-start; }
.forge { display: flex; flex-direction: column; gap: 10px; overflow: auto; }
.forge-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.forge-res { font-size: 18px; }
.forge-pity { display: flex; align-items: center; gap: 10px; font-size: 13px; padding: 6px 10px; background: #120d1c; box-shadow: 0 0 0 1px #000, inset 0 0 0 1px #5a3a1a; }
.forge-pity span { color: #ff9a2e; white-space: nowrap; }
.forge-pity .pbar { flex: 1; height: 8px; background: #241a12; box-shadow: 0 0 0 1px #000; position: relative; overflow: hidden; }
.forge-pity .pbar i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, #b05a10, #ffd34a); }
.forge-pity b { color: #ffd34a; white-space: nowrap; }
.forge-focus { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: 13px; }
.forge-focus .tab { font-size: 13px; padding: 4px 8px; }
.forge-focus .focus-note { flex-basis: 100%; font-size: 12px; margin-top: 2px; }
.crate-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.crate-card { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 10px; text-align: center; background: linear-gradient(180deg, rgba(40,30,58,.9), rgba(18,13,28,.95)); box-shadow: 0 0 0 2px #000, inset 0 0 0 1px var(--cc, #5c4680); position: relative; overflow: hidden; }
.crate-card::before { content: ''; position: absolute; left: 50%; top: 10px; width: 120px; height: 90px; transform: translateX(-50%); background: radial-gradient(ellipse, var(--cg, rgba(200,160,255,.18)), transparent 70%); pointer-events: none; }
.crate-iron { --cc: #8a8e98; --cg: rgba(200,200,210,.12); }
.crate-gilded { --cc: #d8a030; --cg: rgba(255,200,80,.2); }
.crate-astral { --cc: #b45cff; --cg: rgba(180,92,255,.3); }
.crate-art { height: 76px; display: flex; align-items: center; animation: crate-bob 2.4s ease-in-out infinite; }
.crate-astral .crate-art { animation-duration: 1.8s; }
@keyframes crate-bob { 50% { transform: translateY(-3px); } }
.crate-name { font-size: 18px; color: var(--cc); }
.crate-desc { font-size: 12px; min-height: 30px; }
.odds { display: flex; width: 100%; height: 10px; box-shadow: 0 0 0 1px #000; overflow: hidden; }
.odds i { display: block; height: 100%; min-width: 3px; }
.odds-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 8px; font-size: 11px; }
.crate-buy { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-top: 4px; }
.crate-sparks { font-size: 11px; color: #c08a40; }
.forge-recent { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; }
.ficon { display: inline-flex; padding: 2px; background: #120d1c; box-shadow: 0 0 0 1px #000, inset 0 0 0 1px var(--gc); }
.ficon canvas { width: 28px; height: 28px; image-rendering: pixelated; }
/* reveal */
.reveal { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; min-height: 360px; position: relative; }
.reveal-crate.shaking { animation: crate-shake .12s linear infinite; filter: drop-shadow(0 0 10px rgba(255,220,150,.4)); }
@keyframes crate-shake { 0% { transform: translate(0, 0) rotate(0); } 25% { transform: translate(-2px, 1px) rotate(-3deg); } 50% { transform: translate(2px, -1px) rotate(2deg); } 75% { transform: translate(-1px, -2px) rotate(-1deg); } }
.reveal-burst { position: absolute; left: 50%; top: 45%; width: 520px; height: 520px; transform: translate(-50%, -50%); background: radial-gradient(circle, var(--gc) 0%, transparent 60%); opacity: 0; animation: burst 1.1s ease-out forwards; pointer-events: none; }
@keyframes burst { 0% { opacity: .9; transform: translate(-50%, -50%) scale(.2); } 100% { opacity: .18; transform: translate(-50%, -50%) scale(1); } }
.reveal-cards { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; position: relative; }
.rcard { width: 200px; padding: 10px; background: rgba(18,13,28,.96); box-shadow: 0 0 0 2px #000, 0 0 0 3px var(--gc), 0 0 22px -4px var(--gc); animation: card-in .45s cubic-bezier(.2,1.4,.4,1) backwards; display: flex; flex-direction: column; gap: 6px; }
.rcard:nth-child(2) { animation-delay: .08s; } .rcard:nth-child(3) { animation-delay: .16s; } .rcard:nth-child(4) { animation-delay: .24s; } .rcard:nth-child(5) { animation-delay: .32s; }
.rcard.big { width: 320px; }
@keyframes card-in { 0% { opacity: 0; transform: scale(.6) translateY(20px) rotateY(80deg); } 100% { opacity: 1; transform: none; } }
.rcard .rc-top { display: flex; gap: 8px; align-items: center; }
.rcard .igrade { font-size: 11px; color: var(--gc); font-family: var(--font2); }
.rcard .iname { font-size: 15px; color: var(--gc); font-weight: 700; }
.rcard .rc-cmp { font-size: 11px; }
.rcard .rc-cmp .up { color: #5aef6a; } .rcard .rc-cmp .down { color: #ff6a5a; }
.rcard .rc-stats { font-size: 12px; line-height: 1.35; }
.rcard .rc-stats .tr { color: #e6dcc4; } .rcard .rc-stats .pw { color: var(--legendary); }
.rcard .rc-act { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; }
.rcard .rc-act .ok { color: #7aff9a; font-size: 13px; }
.reveal-actions { display: flex; gap: 10px; position: relative; }
/* three crates side by side down to phone width; stacked only on a narrow portrait screen */
@media (max-width: 560px) { .crate-row { grid-template-columns: 1fr; } }
/* short screens (phones held sideways): tighter cards so all three fit without scrolling */
@media (max-height: 520px) {
  .crate-row { gap: 8px; }
  .crate-card { padding: 8px 6px; gap: 4px; }
  .crate-art { height: 56px; }
  .crate-name { font-size: 16px; }
  .crate-desc { min-height: 0; font-size: 11px; }
}

/* passive tree (PoE style) */
.st-wrap.pt { display: flex; flex-direction: column; }
.st-body2 { display: grid; grid-template-columns: 1fr 300px; gap: 10px; min-height: 0; flex: 1; }
.st-view { position: relative; height: min(470px, calc(calc(94 * var(--vh, 1vh)) - 330px)); min-height: 280px; overflow: hidden; cursor: grab; touch-action: none;
  background: radial-gradient(ellipse at center, #241a36 0%, #120d1c 70%); box-shadow: 0 0 0 2px #000, inset 0 0 0 1px #3a2c52; }
.st-view:active { cursor: grabbing; }
.tree-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.tree-svg .ed { stroke: #3a2c52; stroke-width: 3; }
.tree-svg .ed.half { stroke: #7a6a96; stroke-width: 3; stroke-dasharray: 5 4; }
.tree-svg .ed.on { stroke: #ffd34a; stroke-width: 5; filter: drop-shadow(0 0 3px rgba(255,211,74,.6)); }
.tree-svg .tn { cursor: pointer; }
.tree-svg .tn .nb { fill: #1a1426; stroke: #4a3a64; stroke-width: 3; transition: fill .15s; }
.tree-svg .tn .ni { font-size: 15px; text-anchor: middle; dominant-baseline: middle; pointer-events: none; opacity: .35; }
.tree-svg .t-keystone .ni { font-size: 20px; }
.tree-svg .t-start .nb { fill: #3a2c52; stroke: #ffd34a; }
.tree-svg .s-reach .nb { stroke: #7a6a96; }
.tree-svg .s-avail .nb { stroke: var(--ac); fill: #2a1f3c; animation: tn-pulse 1.2s ease-in-out infinite alternate; }
.tree-svg .s-avail .ni { opacity: .85; }
.tree-svg .s-learned .nb { fill: var(--ac); stroke: #fff2a8; }
.tree-svg .s-learned .ni { opacity: 1; }
.tree-svg .t-small.s-learned .nb { fill: #ffd34a; stroke: #fff2a8; }
.tree-svg .t-keystone.s-learned .nb { filter: drop-shadow(0 0 6px var(--ac)); }
.tree-svg .tn.sel .nb { stroke: #ffffff; stroke-width: 5; }
.tree-svg .tn:hover .nb { stroke: #ffffff; }
@keyframes tn-pulse { to { stroke-width: 5; } }
.tree-svg .arm-label { font-size: 22px; text-anchor: middle; opacity: .28; font-family: var(--font2); letter-spacing: 2px; pointer-events: none; }
.st-zoom { position: absolute; right: 8px; top: 8px; display: flex; flex-direction: column; gap: 4px; }
.st-zoom .btn.small { min-width: 0; padding: 0 6px; font-size: 16px; }
.st-hint { position: absolute; left: 8px; bottom: 6px; font-size: 11px; pointer-events: none; }
.st-sum { margin-top: 12px; font-size: 12px; line-height: 1.4; color: #c8f0c0; border-top: 1px dashed rgba(92,70,128,.5); padding-top: 8px; max-height: 160px; overflow: auto; }
.st-sum span { display: block; color: #9a8fb0; font-family: var(--font2); font-size: 11px; margin-bottom: 3px; }
@media (max-width: 900px) { html:not(.zoomed) .st-body2 { grid-template-columns: 1fr; } }
/* inside the hub the tree takes all the height left under the tabs and its header */
.hub .st-view, .hub .st-body2 .st-detail { height: max(220px, calc(calc(94 * var(--vh, 1vh)) - 285px)); max-height: none; }
.st-body2 .st-detail { max-height: min(470px, calc(calc(94 * var(--vh, 1vh)) - 330px)); min-height: 280px; overflow: auto; }

.wtype .wsyn { margin-top: 3px; color: #8fe08a; font-size: 13px; }

/* ---------- title logo: R◆GUE / DEFENDERS (ui/logo.js) ---------- */
.logo2 { display: flex; flex-direction: column; align-items: center; font-family: var(--logo); line-height: .82; user-select: none;
  filter: drop-shadow(0 0 28px rgba(255,150,60,.28)); }
.logo2 .lg-row { display: flex; align-items: flex-end; }
.logo2 .lg-t { display: inline-block; letter-spacing: 4px;
  background: linear-gradient(180deg, #fff6d0 0 30%, #ffd34a 30% 58%, #ff9a2e 58% 80%, #d8601e 80%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(3px 0 0 #2a0c06) drop-shadow(-3px 0 0 #2a0c06) drop-shadow(0 -3px 0 #2a0c06) drop-shadow(0 4px 0 #2a0c06) drop-shadow(0 5px 0 #7a2e0e) drop-shadow(0 4px 0 #2a0c06); }
.logo2 .lg-top .lg-t { font-size: clamp(52px, min(calc(8.4 * var(--vw, 1vw)), calc(14 * var(--vh, 1vh))), 120px); }
.logo2 .lg-bot .lg-t { font-size: clamp(42px, min(calc(6.6 * var(--vw, 1vw)), calc(11 * var(--vh, 1vh))), 94px); letter-spacing: 6px; margin-top: 2px;
  background-image: linear-gradient(180deg, #efe0ff 0 30%, #c590ff 30% 60%, #8a4ee0 60% 82%, #5a2aa8 82%); }
.logo2 .lg-o { position: relative; display: inline-block; width: clamp(32px, min(calc(5.2 * var(--vw, 1vw)), calc(8.6 * var(--vh, 1vh))), 74px); height: clamp(50px, min(calc(8 * var(--vw, 1vw)), calc(13.4 * var(--vh, 1vh))), 112px); margin: 0 6px 4px; }
.logo2 .lg-gem { position: absolute; inset: 0; width: 100%; height: 100%; filter: drop-shadow(0 0 10px rgba(106,208,255,.75)) drop-shadow(0 4px 0 #061226); animation: lg-float 3.2s ease-in-out infinite; }
.logo2 .lg-glow { position: absolute; left: -40%; right: -40%; bottom: -12%; height: 30%; background: radial-gradient(ellipse at center, rgba(106,208,255,.5), rgba(106,208,255,0) 70%); animation: lg-pulse 3.2s ease-in-out infinite; }
.logo2 .lg-spark { position: absolute; width: 6px; height: 6px; background: #fff; box-shadow: 0 0 6px #bff8ff; animation: lg-twinkle 2.4s steps(4) infinite; }
.logo2 .lg-spark.s1 { left: -8px; top: 18%; } .logo2 .lg-spark.s2 { right: -10px; top: 52%; animation-delay: 1.2s; }
.logo2 .lg-sub { display: flex; align-items: center; gap: 12px; margin-top: 12px; font-family: var(--font); font-size: clamp(16px, calc(1.8 * var(--vw, 1vw)), 24px); letter-spacing: 6px; color: #bff4ff; text-shadow: 0 2px 0 #0b1f3a, 0 0 12px rgba(106,208,255,.5); }
.logo2 .lg-sub i { display: block; width: 46px; height: 4px; background: linear-gradient(90deg, transparent, #6ad0ff); box-shadow: 0 2px 0 #0b1f3a; }
.logo2 .lg-sub i:last-child { transform: scaleX(-1); }
@keyframes lg-float { 50% { transform: translateY(-6px); } }
@keyframes lg-pulse { 50% { opacity: .55; transform: scaleX(.85); } }
@keyframes lg-twinkle { 0%, 60%, 100% { opacity: 0; } 70%, 90% { opacity: 1; } }

/* ---------- title menu ---------- */
.menu-col { display: flex; flex-direction: column; gap: 0; width: 320px; }
.menu-col .btn { display: flex; align-items: center; gap: 10px; width: 100%; font-size: 21px; padding: 0 8px; margin: 3px 0; }
.menu-col .btn .bi { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; font-size: 16px; background: rgba(0,0,0,.35); box-shadow: inset 0 0 0 2px rgba(0,0,0,.5), inset 0 2px 0 rgba(255,255,255,.08); flex: none; }
.menu-col .btn .bl { flex: 1; }
.menu-col .btn.primary { font-size: 25px; padding: 3px 8px; }
.menu-col .btn.primary .bi { width: 34px; height: 34px; font-size: 19px; }
.menu-col .btn.minor { font-size: 17px; margin: 2px 0; }
.menu-col .btn.minor .bi { width: 22px; height: 22px; font-size: 13px; }
.menu-col .sep { height: 4px; }
.title-wrap:has(.menu-col) { gap: 14px; margin-bottom: 40px; }
.menu-stats { display: flex; gap: 18px; justify-content: center; font-size: 17px; color: var(--muted); }
.menu-stats b { color: var(--text); }

/* ---------- skill tree: saved builds popup ---------- */
.st-modal { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(6,3,12,.72); z-index: 20; }
.pre-panel { width: min(760px, calc(94 * var(--vw, 1vw))); display: flex; flex-direction: column; gap: 10px; }
.pre-help { font-size: 15px; line-height: 1.35; }
.pre-row { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: center; padding: 8px 10px; background: rgba(0,0,0,.28); box-shadow: inset 0 0 0 2px #2a1f3c; }
.pre-row.cur { box-shadow: inset 0 0 0 2px #6bf27a; background: rgba(40,90,50,.18); }
.pre-row.empty .pre-info b { color: var(--muted); font-weight: 400; }
.pre-n { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; font-size: 22px; color: var(--gold); background: #0b0812; box-shadow: inset 0 0 0 2px #3b2d52; }
.pre-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 19px; }
.pre-info small { font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pre-info input[type=text] { font-size: 18px; padding: 3px 8px; width: 100%; max-width: 280px; }
.pre-tag { font-size: 12px; color: #0b1a0e; background: #6bf27a; padding: 0 5px; vertical-align: 2px; }
.pre-warn { color: #ffb86a; }
.pre-acts { display: flex; gap: 6px; align-items: center; }
.pre-acts .btn.small { margin: 0; }

/* pixel-art icons that replace emoji (ui/pixicons.js) */
img.pi { display: inline-block; width: 1.05em; height: 1.05em; image-rendering: pixelated; vertical-align: -0.16em; margin: 0 .04em; pointer-events: none; }
.tree-svg .ni-px { image-rendering: pixelated; pointer-events: none; }
.tree-svg .ni-px { opacity: .4; }
.tree-svg .s-reach .ni-px { opacity: .55; }
.tree-svg .s-avail .ni-px { opacity: .9; }
.tree-svg .s-learned .ni-px { opacity: 1; }

/* ---------- results screen (ui/results.js) ---------- */
.results2 { width: min(1120px, calc(96 * var(--vw, 1vw))); max-height: calc(96 * var(--vh, 1vh)); overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 10px 16px 12px; }
.rs-banner { text-align: center; position: relative; padding: 4px 0 2px; }
.rs-title { font-family: var(--logo); font-size: clamp(54px, calc(8 * var(--vw, 1vw)), 84px); line-height: .9; letter-spacing: 6px;
  background: linear-gradient(180deg, #fff6d0 0 34%, #ffd34a 34% 62%, #ff9a2e 62% 84%, #d8601e 84%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(3px 0 0 #2a0c06) drop-shadow(-3px 0 0 #2a0c06) drop-shadow(0 -3px 0 #2a0c06) drop-shadow(0 4px 0 #2a0c06) drop-shadow(0 0 22px rgba(255,170,60,.45));
  animation: rs-pop .6s cubic-bezier(.2,1.6,.4,1) backwards; }
.results2.lose .rs-title { background-image: linear-gradient(180deg, #ffd8d0 0 34%, #ff8a7a 34% 62%, #e0403a 62% 84%, #8a1a1a 84%); filter: drop-shadow(3px 0 0 #1a0606) drop-shadow(-3px 0 0 #1a0606) drop-shadow(0 -3px 0 #1a0606) drop-shadow(0 4px 0 #1a0606) drop-shadow(0 0 22px rgba(255,60,60,.35)); }
.rs-sub { font-size: 18px; color: #d8cce8; margin-top: 4px; }
.rs-chips { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }
.rs-chip { display: flex; align-items: baseline; gap: 6px; padding: 3px 10px; background: rgba(0,0,0,.35); box-shadow: inset 0 0 0 2px #2e2344; }
.rs-chip span { font-size: 16px; } .rs-chip b { font-size: 20px; } .rs-chip small { font-size: 13px; color: var(--muted); }
@keyframes rs-pop { from { transform: scale(.4); opacity: 0; } }

.rs-track { display: flex; flex-direction: column; gap: 3px; }
.rs-cells { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 3px; }
.rs-cells i { height: 14px; background: #120d1c; box-shadow: inset 0 0 0 1px #2e2344; display: flex; align-items: center; justify-content: center; font-size: 10px; font-style: normal; }
.rs-cells i.done { background: linear-gradient(180deg, #ffe680, #e0a020); box-shadow: inset 0 -2px 0 #8a5a0a; }
.rs-cells i.boss { height: 18px; margin-top: -2px; }
.rs-cells i.boss.done { background: linear-gradient(180deg, #ffb07a, #d8501e); }
.rs-cells i.at { background: #ff5a4e; box-shadow: 0 0 10px #ff5a4e; animation: blink 1s steps(2) infinite; }
.rs-realms { display: flex; } .rs-realms span { flex: 1; text-align: center; font-size: 12px; color: var(--muted); letter-spacing: 1px; }

.rs-body { display: grid; grid-template-columns: 1.45fr 1fr; gap: 12px; flex: none; }
.rs-body h3 { font-size: 15px; letter-spacing: 3px; color: var(--muted); text-transform: uppercase; margin: 0 0 6px; font-family: var(--font2); font-weight: 400; }
.rs-heroes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rs-hero { position: relative; padding: 8px 10px 8px 12px; background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(0,0,0,.25)); box-shadow: inset 0 0 0 2px #2a1f3c, inset 4px 0 0 var(--pc); animation: drop .45s backwards; }
.rs-hero:nth-child(2) { animation-delay: .08s; } .rs-hero:nth-child(3) { animation-delay: .16s; } .rs-hero:nth-child(4) { animation-delay: .24s; }
.rs-hero.awarded { box-shadow: inset 0 0 0 2px #5a4a1e, inset 4px 0 0 var(--pc); }
.rs-hh { display: flex; gap: 10px; align-items: center; }
.rs-port canvas { width: 52px; height: 52px; background: radial-gradient(circle, #2a2040, #120d1c); box-shadow: 0 0 0 2px #000, 0 0 0 3px var(--cc); }
.rs-hn { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.rs-hn > b { font-size: 21px; }
.rs-tag { font-family: var(--font2); font-size: 10px; padding: 1px 4px; color: #120d1c; }
.rs-you { font-family: var(--font2); font-size: 10px; padding: 1px 4px; color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.rs-award { flex-basis: 100%; font-size: 14px; color: var(--gold); height: 18px; }
.rs-dmg { height: 5px; background: #0b0812; margin: 7px 0 6px; } .rs-dmg i { display: block; height: 100%; background: var(--pc); box-shadow: 0 0 6px var(--pc); }
.rs-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; text-align: center; }
.rs-st { display: flex; flex-direction: column; align-items: center; line-height: 1.05; }
.rs-st span { font-size: 13px; } .rs-st b { font-size: 18px; } .rs-st small { font-size: 11px; color: var(--muted); }
.rs-st.zero b { color: #6a6080; } .rs-st.bad b { color: #ff8a7a; }

.rs-side { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.rs-box { padding: 8px 10px; background: rgba(0,0,0,.25); box-shadow: inset 0 0 0 2px #2a1f3c; }
.rs-xp + .rs-xp { margin-top: 8px; }
.rs-xh { display: flex; align-items: baseline; gap: 8px; font-size: 18px; }
.rs-xh .rs-lv { color: var(--muted); } .rs-xh .rs-lv b { color: var(--text); }
.rs-xh .rs-gain { margin-left: auto; color: var(--green); }
.rs-bar { position: relative; height: 16px; margin-top: 3px; background: #0b0812; box-shadow: inset 0 0 0 2px #000, 0 0 0 1px #3b2d52; overflow: hidden; }
.rs-bar i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(180deg, #fff 0 15%, var(--cc) 15% 70%, rgba(0,0,0,.25) 70%), var(--cc); box-shadow: 2px 0 0 #fff8; }
.rs-bar span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--font2); font-size: 10px; color: #fff; text-shadow: 0 1px 0 #000, 1px 0 0 #000, -1px 0 0 #000, 0 -1px 0 #000; }
.rs-up { height: 0; overflow: hidden; font-size: 14px; color: var(--gold); transition: height .25s; }
.rs-up.show { height: 20px; margin-top: 3px; }
.rs-xp.flash .rs-bar { animation: rs-flash .5s; }
.rs-xp.flash .rs-lv b { animation: rs-pop .4s cubic-bezier(.2,1.8,.4,1); display: inline-block; color: var(--gold); }
@keyframes rs-flash { 0% { box-shadow: inset 0 0 0 2px #000, 0 0 0 1px #fff, 0 0 18px #ffd34a; filter: brightness(2); } }
.rs-cur { display: flex; gap: 18px; justify-content: center; margin-bottom: 8px; }
.rs-cur > div { display: flex; align-items: baseline; gap: 6px; font-size: 26px; } .rs-cur small { font-size: 15px; color: var(--muted); }
.rs-loot { display: flex; flex-direction: column; gap: 5px; max-height: 190px; overflow-y: auto; }
.rs-item { display: flex; align-items: center; gap: 8px; padding: 4px 8px; background: rgba(0,0,0,.3); box-shadow: inset 0 0 0 2px #2a1f3c, inset 3px 0 0 var(--gc); animation: rs-loot .5s backwards; }
.rs-item.g-epic, .rs-item.g-legendary { box-shadow: inset 0 0 0 2px var(--gc), 0 0 14px var(--gc); }
.rs-item .rs-ic canvas { display: block; }
.rs-item b { display: block; font-size: 16px; } .rs-item small { font-size: 12px; color: var(--muted); }
.rs-none { font-size: 14px; text-align: center; padding: 6px; }
@keyframes rs-loot { from { transform: translateX(30px); opacity: 0; } }
.rs-acts { display: flex; gap: 10px; justify-content: center; align-items: center; flex-wrap: wrap; flex: none; }
.rs-acts .btn { min-width: 170px; text-align: center; }
.rs-acts .btn.small { min-width: 0; }

@media (max-width: 820px), (max-height: 520px) {
  .results2 { padding: 8px 10px; }
  .rs-body { grid-template-columns: 1fr; }
  .rs-side { order: -1; }
  .rs-heroes { grid-template-columns: 1fr 1fr; }
  .rs-stats small { display: none; }
  .rs-realms { display: none; }
  .rs-acts .btn { min-width: 0; flex: 1; font-size: 17px; }
  .rs-acts { position: sticky; bottom: -8px; margin: 0 -10px -8px; padding: 8px 10px 10px; background: linear-gradient(180deg, rgba(23,17,33,.85), #171121 40%); z-index: 2; }
  .rs-acts .btn.small { flex: none; }
}
@media (max-width: 820px) { .results2 { max-height: calc(calc(100 * var(--vh, 1vh)) - 70px); align-self: flex-start; margin-top: 8px; } }
@media (max-width: 520px) { .rs-heroes { grid-template-columns: 1fr; } .rs-chip small { display: none; } }

/* ---------- crystal health + Surge meter (top of the HUD) ---------- */
.cbox { position: relative; display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.cbox .cico, .surge2 .sico { flex: none; width: 18px; font-size: 16px; line-height: 1; }
.cbox .bar.crystal { flex: 1; height: 18px; }
.bar.crystal > i.hp { background: linear-gradient(180deg, #dffaff 0 2px, #6ad0ff 2px 12px, #2c78d8 12px); }
.bar.crystal.low > i.hp { background: linear-gradient(180deg, #ffe0e0 0 2px, #ff6a6a 2px 12px, #b82a3a 12px); }
.bar.crystal .cnum { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 2;
  font-family: 'Silkscreen', monospace; font-size: 16px; line-height: 1; color: #fff; letter-spacing: 0;
  text-shadow: 1px 0 0 #0b1f3a, -1px 0 0 #0b1f3a, 0 1px 0 #0b1f3a, 0 -1px 0 #0b1f3a; -webkit-font-smoothing: none; font-smooth: never; }
.cbox .c-alert { position: absolute; right: -4px; top: -16px; margin: 0; font-size: 12px; text-shadow: 0 1px 0 #000; }
.surge2 { display: flex; align-items: center; gap: 6px; margin-top: 5px; }
.surge2 .segs { flex: 1; display: grid; grid-template-columns: repeat(20, 1fr); gap: 2px; padding: 2px; background: #0b0812; box-shadow: 0 0 0 2px #000; }
.surge2 .segs i { height: 6px; background: #241c34; box-shadow: inset 0 -1px 0 #120d1c; }
.surge2 .segs i.on { background: #6ad0ff; box-shadow: inset 0 1px 0 #dffaff, inset 0 -2px 0 #2c78d8; }
.surge2.ready .segs { box-shadow: 0 0 0 2px #000, 0 0 10px #ffd34a; }
.surge2.ready .segs i { background: #ffd23f; box-shadow: inset 0 1px 0 #fff6c0, inset 0 -2px 0 #b07a10; animation: surgechase 1.4s steps(1) infinite; animation-delay: calc(var(--i) * 0.07s); }
@keyframes surgechase { 0% { background: #ffffff; } 6% { background: #ffd23f; } }
.surge2 .slab { flex: none; min-width: 34px; text-align: left; font-family: 'Silkscreen', monospace; font-size: 8px; color: #bff4ff; text-shadow: 0 1px 0 #000; display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.surge2.ready .slab { color: #ffe27a; font-size: 8px; }
.surge2 .slab .g-key, .surge2 .slab .g-btn { font-size: 9px; padding: 0 3px; }
@media (prefers-reduced-motion: reduce) { .surge2.ready .segs i { animation: none; } }
.tier-line { margin-top: 6px; max-width: 640px; text-align: center; font-size: 13px; line-height: 1.5; color: #e0c8ff; }
.tier-line span[title] { cursor: help; white-space: nowrap; }
.rs-unlock { margin-top: 4px; color: #ffd34a; font-size: 16px; text-shadow: 0 1px 0 #000; }

.act.asc.locked { opacity: .75; } .act.asc .asc-req .ok { color: #5aef6a; } .act.asc .asc-req .no { color: #ff8a7a; }
.acts .pick-h { font-size: 12px; color: #c8bcd8; margin: 4px 2px 2px; }
.act.pick { padding-top: 4px; padding-bottom: 4px; } .act.pick-cancel { --ac: #5a4a6a; justify-content: center; }
.rr-mark { font-size: 11px; cursor: help; }

/* ---------------------------------------------------------------- touch (phones held sideways) */
html, body { overscroll-behavior: none; }
body.touch { -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
body.touch #hintbar, body.touch .sk .k { display: none !important; }   /* no keyboard/pad glyphs for fingers */
#rotate { position: fixed; inset: 0; z-index: 90; display: none; place-items: center; text-align: center; background: #0b0812; color: var(--gold); font: 22px/1.4 var(--font); padding: 24px; }
#rotate span { display: block; font-size: 64px; animation: rot 1.6s ease-in-out infinite; }
@keyframes rot { 0%, 30% { transform: rotate(0); } 60%, 100% { transform: rotate(-90deg); } }
@media (orientation: portrait) and (pointer: coarse) { #rotate { display: grid; } }
body.touch .g, body.touch .g-key, body.touch .g-btn { display: none !important; }   /* key/button glyphs mean nothing to a finger */
/* .zoomed (set with --uiz): phone-width media rules that stack panels don't apply; the zoomed layout is full size */
/* small screens (phones sideways): the whole UI layer is scaled by --uiz (set in main.js from the window size). Viewport
   units would shrink with it, so sizes use --vw/--vh: 1% of the screen in zoomed units (also set in main.js). */
#ui { zoom: var(--uiz, 1); }
/* in a touch game the controls own the bottom corners: the team cards shrink to a slim row (below), the XP bar
   sits low between the two thumbs, and the gear makes room for the touch pause button */
/* phones: a slim row of the team's cards above the XP bar, between the thumbs: portrait, tag, HP and ultimate (the
   skills live on the touch buttons); touches pass through them to the controls */
body.touch .hud-heroes { bottom: 30px; gap: 6px; pointer-events: none; }
body.touch .hcard { width: 132px; padding: 3px 5px 3px 6px; grid-template-columns: 22px 1fr; gap: 5px; pointer-events: none; }
body.touch .hcard canvas { width: 22px; height: 22px; }
body.touch .hcard .hc-tag { font-size: 7px; bottom: -6px; padding: 0 2px; }
body.touch .hcard .nm { font-size: 10px; }
body.touch .hcard .nm .cl { display: none; }
body.touch .hcard .bar { height: 9px; margin-top: 2px; }
body.touch .hcard .bar .hpt { font-size: 8px; }
body.touch .hcard .ubar { height: 2px; margin: 2px 0 1px; }
body.touch .hcard .skills { display: none; }
body.touch .hcard .hc-down { font-size: 10px; letter-spacing: 1px; }
body.touch .hud-xp { bottom: 8px; width: 560px; }
body.touch .hud-gear { visibility: hidden; height: 66px; }

/* elite panel: stagger bar and moves; your own statuses */
.bar.poisebar { height: 3px; margin-top: 2px; background: #120d18; box-shadow: 0 0 0 1px #000; }
.bar.poisebar > i { display: block; height: 100%; background: #e8e0f0; transition: width .12s linear; }
.bar.poisebar.stag > i { background: #ffe46a; animation: xpglow .25s ease-in-out infinite alternate; }
.hud-elite .el-moves { margin-top: 2px; font-size: 11px; text-align: center; color: #ffd34a; opacity: .9; }
.hud-mystatus { position: absolute; left: 50%; bottom: 130px; transform: translateX(-50%); display: flex; gap: 8px; pointer-events: none; }
body.touch .hud-mystatus { bottom: 34px; }
.stchip { display: flex; align-items: center; gap: 5px; padding: 3px 8px 3px 4px; background: rgba(15,10,24,.85); box-shadow: 0 0 0 2px #000, 0 0 0 3px var(--c); font-size: 15px; text-shadow: 0 2px 0 #000; }
.stchip b { color: var(--c); letter-spacing: 1px; } .stchip em { font-style: normal; color: #fff; font-size: 13px; } .stchip i { font-style: normal; color: var(--muted); font-size: 11px; }
.stchip .sticon { image-rendering: pixelated; height: 21px; }
.stchip.buzz { animation: stbuzz .4s linear; }
@keyframes stbuzz { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-4px); } 40% { transform: translateX(4px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(3px); } }
.toast .sticon, #toast .sticon { image-rendering: pixelated; height: 14px; vertical-align: middle; }

/* pact offer timer; the 3-2-1 before a wave */
.hud-pact .pc-time { margin-top: 4px; font-size: 12px; text-align: center; color: #c8bcd8; display: flex; align-items: center; justify-content: center; gap: 8px; }
.hud-pact .pc-time b { color: #fff; }
.hud-pact .pc-time.low b { color: #ff7a7a; }
.hud-pact .pc-tbar { width: 120px; height: 4px; background: #120d18; box-shadow: 0 0 0 1px #000; position: relative; }
.hud-pact .pc-tbar i { position: absolute; left: 0; top: 0; bottom: 0; background: #b48cff; }
.hud-pact .pc-time.low .pc-tbar i { background: #ff7a7a; }
.hud-count { height: 0; text-align: center; font-size: 26px; color: #ffd34a; text-shadow: 0 2px 0 #000, 0 0 6px #000; line-height: 1; opacity: 0; }
.hud-count.pop { animation: cnpop .9s ease-out forwards; }
@keyframes cnpop { 0% { transform: scale(1.6); opacity: 0; } 15% { transform: scale(1); opacity: 1; } 70% { opacity: .9; } 100% { opacity: 0; transform: translateY(6px); } }

/* what a power's rarity adds, on the level-up card */
.card .rbonus { margin: 6px auto 0; padding: 2px 6px; font-size: 12px; line-height: 1.25; color: #fff; background: rgba(0,0,0,.25); box-shadow: inset 0 0 0 1px var(--rc); max-width: 92%; }
.card .rbonus b { color: var(--rc); font-weight: normal; letter-spacing: 1px; text-transform: uppercase; font-size: 11px; margin-right: 3px; }

.sk.nope { animation: sknope .3s linear; }
@keyframes sknope { 0%, 100% { transform: translateX(0); filter: none; } 25% { transform: translateX(-2px); filter: brightness(1.6); } 75% { transform: translateX(2px); } }

/* the wave title's countdown between waves */
.hud-wave .nextin { font-style: normal; font-size: 15px; color: #e8e0f0; margin-left: 10px; vertical-align: middle; }
.hud-wave .nextin.soon { color: #ff7a6a; }

/* gear crit hit its cap */
.capmark, .hs-cap { font-size: 10px; font-style: normal; color: var(--gold, #ffd23f); letter-spacing: 1px; }
.privacy-link { position: fixed; left: calc(12px + env(safe-area-inset-left)); bottom: 8px; font-family: var(--font2); font-size: 13px; color: #8a7fa0; text-decoration: none; }
.privacy-link:hover { color: #c8b8ff; }

/* ---- the room browser */
.browser { width: min(1100px, calc(96 * var(--vw, 1vw))); height: min(760px, calc(92 * var(--vh, 1vh))); display: flex; flex-direction: column; gap: 8px; }
.br-head { display: flex; align-items: center; gap: 12px; }
.br-head h2 { margin: 0; }
.br-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.br-filters input { width: 240px; }
.br-cols, .br-row { display: grid; grid-template-columns: 2.2fr 1.6fr 1fr 1.1fr 80px; gap: 10px; align-items: center; }
.br-cols { font-size: 13px; color: var(--muted); padding: 0 10px; text-transform: uppercase; letter-spacing: 1px; }
.br-list { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; padding-right: 4px; scrollbar-width: thin; }
.br-row { padding: 6px 10px; background: #1d1529; box-shadow: inset 0 0 0 2px #2a1f3c; cursor: pointer; min-height: 46px; }
.br-row:hover, .br-row.sel { box-shadow: inset 0 0 0 2px var(--gold); }
.br-row.busy { opacity: .6; cursor: default; }
.br-row small { display: block; color: var(--muted); font-size: 12px; }
.br-name b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.br-heroes { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; }
.br-heroes small { width: 100%; }
.br-hero { width: 18px; height: 18px; display: inline-grid; place-items: center; font-style: normal; font-size: 12px; font-weight: 700; color: #120d18; background: var(--hc); box-shadow: inset 0 -2px 0 rgba(0,0,0,.25); }
.br-hero.empty { background: transparent; box-shadow: inset 0 0 0 1px #3b2d52; }
.br-state { font-size: 14px; color: var(--muted); }
.br-state.ok { color: var(--green); }
.br-empty, .br-more { text-align: center; color: var(--muted); padding: 24px 0; }
.br-more { padding: 10px 0; font-size: 13px; }
.br-err { color: var(--red); min-height: 18px; }

/* reconnecting overlay (a dropped online connection) */
#reconn { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; background: rgba(8,4,16,.6); }
#reconn h2 { animation: rcpulse 1.2s ease-in-out infinite; }
@keyframes rcpulse { 50% { opacity: .55; } }

/* what a skill tree arm is about (Engineer: you or your buildings) */
.st-about { font-size: 12px; color: #9ae8d8; margin-top: 2px; }

/* the Engineer's turret skill: how many turrets stand, and a red flash when one is hit (a stronger one when it falls) */
.sk .tcnt { position: absolute; left: 0; top: 0; z-index: 3; padding: 0 2px; font: 9px/11px var(--font); color: #fff; background: #1a7a6e; box-shadow: 0 0 0 1px #000; pointer-events: none; }
.sk .tcnt.none { background: #3a3046; color: #a898b8; }
.sk.thit { animation: skthit .25s ease-out; }
.sk.tdie { animation: sktdie .6s ease-out; }
@keyframes skthit { 0% { box-shadow: 0 0 0 2px #ff3a3a, inset 0 0 10px rgba(255,40,40,.8); } 100% { box-shadow: none; } }
@keyframes sktdie { 0%, 40% { box-shadow: 0 0 0 3px #ff3a3a, inset 0 0 16px rgba(255,40,40,.95); } 100% { box-shadow: none; } }
/* the Engineer's Overdrive running: its tile glows orange and counts down */
.sk.ult.active { box-shadow: 0 0 0 1px #000, inset 0 0 0 2px #ff8a3a, 0 0 8px rgba(255, 120, 40, .8); }
.sk.ult.active .cdn { color: #ffd08a; }
/* Settings > Show FPS */
#perf { position: fixed; left: 50%; top: 2px; transform: translateX(-50%); z-index: 80; padding: 2px 8px; font: 12px var(--font); color: #e8dcff; background: rgba(10, 6, 16, .75); pointer-events: none; white-space: nowrap; }
/* low health: the screen's edges glow red and pulse like a heartbeat (main.js lowHealth sets the strength and pace) */
#lowhp { position: fixed; inset: 0; z-index: 25; pointer-events: none; opacity: 0; transition: opacity .4s;
  background: radial-gradient(ellipse at center, rgba(160, 0, 20, 0) 52%, rgba(180, 0, 24, .35) 78%, rgba(200, 10, 30, .7) 100%);
  animation: lowbeat var(--beat, 1s) ease-out infinite; }
@keyframes lowbeat { 0% { filter: brightness(1.5); } 15% { filter: brightness(.9); } 30% { filter: brightness(1.3); } 50%, 100% { filter: brightness(.75); } }

/* stat explanations: skill tree node panel and hero sheet rows */
.st-help { margin-top: 8px; padding: 6px 8px; border-radius: 6px; background: rgba(120,100,170,.14); font-size: 13px; line-height: 1.4; color: #d8cfe8; }
.st-help > span { display: block; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted, #9a8ab8); margin-bottom: 2px; }
.st-help b { color: #fff2c8; }
.hs-det > summary { list-style: none; cursor: pointer; }
.hs-det > summary::-webkit-details-marker { display: none; }
.hs-det[open] > summary { border-bottom-color: transparent; }
.hs-q { font-style: normal; font-size: 11px; color: #9a8ab8; border: 1px solid rgba(154,138,184,.5); border-radius: 50%; padding: 0 4px; margin-left: 4px; }
.hs-help { font-size: 12px; line-height: 1.35; color: #d8cfe8; padding: 2px 4px 6px; border-bottom: 1px dashed rgba(92,70,128,.35); }

/* Heroes hub: every section (Equipment, Forge, Skill Tree, Stats) sits in the same fixed frame, so switching tabs
   never moves the tabs or resizes the window; content that's taller scrolls inside */
.hub { height: min(860px, calc(94 * var(--vh, 1vh))); max-height: none; }
.hub > :not(.hub-head) { flex: 1 1 0; min-height: 0; max-height: none; }
.hub .armory { height: auto; }
.hub .hub-panel { max-height: none; overflow: auto; }
.hub .st-wrap { max-height: none; overflow: hidden; }
.hub .st-body2 { grid-template-rows: minmax(0, 1fr); }
.hub .st-view, .hub .st-body2 .st-detail { height: auto; min-height: 0; max-height: none; }
.hub .st-body2 .st-detail { overflow: auto; }
@media (max-width: 900px) {
  html:not(.zoomed) .hub .st-wrap { overflow: auto; }
  html:not(.zoomed) .hub .st-body2 { grid-template-rows: auto; }
  html:not(.zoomed) .hub .st-view { height: max(220px, calc(calc(94 * var(--vh, 1vh)) - 150px)); }
}

.hs-num { color: #fff2c8; }
.st-delta { color: #9a8ab8; font-size: 12px; }
.st-delta b { color: var(--green, #6ae07a); }

.lv-rr { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 8px; pointer-events: auto; }
.lv-rr .muted { font-size: 13px; }

/* the stats sheet's opened row: what it does, then where it comes from (an aligned two-column table) */
.hs-help { padding: 4px 6px 8px; }
.hs-lab { font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: #9a8ab8; margin: 4px 0 2px; }
.hs-what { font-size: 12px; line-height: 1.35; color: #d8cfe8; }
.hs-src { display: grid; grid-template-columns: 1fr auto; gap: 1px 12px; font-size: 12px; background: rgba(0,0,0,.22); border-radius: 4px; padding: 4px 8px; }
.hs-src span { color: #c8bcdc; } .hs-src b { text-align: right; font-weight: normal; color: #e8e0f4; }
.hs-src .base { color: #9a8ab8; } .hs-src b.up { color: var(--green, #6ae07a); } .hs-src b.down { color: var(--red, #ff5a4e); }
.hs-src .none { grid-column: 1 / -1; color: #7a6a98; font-style: italic; }
.hs-src .tot { border-top: 1px solid rgba(154,138,184,.35); padding-top: 2px; margin-top: 1px; color: #fff2c8; font-weight: bold; }
