html{scrollbar-color:var(--scroll-thumb) var(--scroll-track);scrollbar-width:thin}body{font-family:var(--font,Arial,sans-serif);background:var(--bg);background-image:var(--game-bg-image,none);background-size:cover;background-position:center;background-attachment:fixed;color:var(--text);margin:0;padding:20px;padding-top:86px;scroll-padding-top:86px}
.fixedTopHeader{position:fixed;top:0;left:0;right:0;z-index:15;background:var(--top);border-bottom:1px solid var(--border);padding:10px 20px;box-shadow:none;box-sizing:border-box;max-height:185px;overflow-y:auto}
.fixedTopHeader{display:flex;flex-direction:column}.fixedTopHeader .topbar{margin-bottom:0;padding:10px}.fixedTopHeader #fixedResourceHeader{order:1}.oldHeader{display:none!important}

h1{text-align:center;margin-top:0}h2,h3{margin-top:0}.titleRow{position:relative;display:flex;justify-content:center;align-items:center;margin-top:0;margin-bottom:16px;min-height:42px}.titleRow h1{margin:0;text-align:center}.titleTabs{position:absolute;left:0;top:50%;transform:translateY(-50%);display:flex;gap:8px;flex-wrap:wrap;margin:0!important}.upgradeListGrid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:10px}.creditTabs{display:flex;gap:8px;margin:0 0 12px;flex-wrap:wrap}.creditTab{padding:9px 13px;background:#333;border:none;color:white;cursor:pointer;border-radius:8px}.creditTab.active{background:#6d8cff}.creditPanel{display:none}.creditPanel.active{display:block}
.topbar{background:#222;border:1px solid #333;border-radius:10px;padding:14px;margin-bottom:14px}
.tabs{display:flex;gap:8px;margin-bottom:15px;flex-wrap:wrap}
.tab{padding:10px 14px;background:#333;border:none;color:white;cursor:pointer;border-radius:8px}
.tab.active{background:var(--accent)}
.panel{display:none}.panel.active{display:block}
.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:12px}
.card,.upgradeBox{background:var(--panel);padding:12px;border-radius:10px;border:1px solid #333}
.generatorCard{background:var(--card);padding:12px;border-radius:8px}
.upgradeBox{margin-top:14px}
.upgrade{background:#303030;border:1px solid #444;padding:10px;margin:8px 0;border-radius:8px}
button{padding:7px 11px;border:0;border-radius:7px;cursor:pointer;margin-top:6px}.auctionPost button{padding:5px 9px;margin-top:4px}
button:disabled{cursor:not-allowed;opacity:.45}
.small{color:var(--muted);font-size:.9em}
.bought{color:var(--good);font-weight:bold}
.cost{color:#ffd166}
.cost-affordable{color:#7ee787!important;font-weight:bold}
.cost-unaffordable{color:#ff6b6b!important;font-weight:bold}.cost-purchased{color:#ffffff!important;font-weight:bold}
.bar{height:4px;background:#111;border:1px solid #2b2b2b;border-radius:999px;overflow:hidden;margin:6px 0;box-shadow:0 0 5px rgba(109,140,255,.12) inset}
.barFill{
 height:100%;
 width:100%;
 transform:scaleX(0);
 transform-origin:left center;
 transition:transform .18s linear,background .12s ease,box-shadow .12s ease;
 will-change:transform;
}
.barFill.affordable{background:#7ee787;box-shadow:0 0 8px rgba(126,231,135,.65)}
.barFill.unaffordable{background:#ff6b6b;box-shadow:0 0 8px rgba(255,107,107,.55)}
.hidden{display:none!important}.ownedUpgradeButton{display:none!important;visibility:hidden!important}.mainTabs{display:flex;gap:8px;margin:0 0 15px;flex-wrap:wrap}.mainTab{padding:11px 16px;background:#2f2f2f;border:none;color:white;cursor:pointer;border-radius:8px}.mainTab.active{background:#6d8cff}.mainPanel{display:none}.mainPanel.active{display:block}.auctionSearch{width:100%;box-sizing:border-box;padding:9px 11px;border-radius:8px;border:1px solid var(--border);background:var(--input);color:var(--text);margin-top:10px}.auctionGrid{display:block}.auctionPost{background:#262626;border:1px solid #3a3a3a;border-radius:8px;padding:8px 10px;transition:background-color .25s ease,box-shadow .25s ease;font-size:.92em}.auctionSection{margin:12px 0}.auctionSectionHeader{position:static;z-index:auto;background:#202020;border:1px solid #383838;border-radius:8px;padding:7px 10px;margin-bottom:7px;color:#d7e2ff;box-shadow:none;font-size:.95em}.auctionSectionGrid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:7px}.auctionPost.buy{box-shadow:0 0 10px rgba(126,231,135,.08) inset}.auctionPost.sell{box-shadow:0 0 10px rgba(255,209,102,.08) inset}.auctionMeta{color:#aaa;font-size:.82em;margin:3px 0}.auctionTitle{font-weight:bold;margin-bottom:4px}.auctionInventory{display:flex;gap:6px;flex-wrap:wrap;margin-top:8px}.auctionResourcePill{font-size:.78em;background:#171717;border:1px solid #333;border-radius:999px;padding:4px 8px;color:#cfcfcf;transition:background .15s ease,box-shadow .15s ease,color .15s ease,border-color .15s ease}.auctionResourcePill.hoverGain{background:#24442b!important;box-shadow:0 0 14px rgba(126,231,135,.85)!important;border-color:#7ee787!important;color:#fff!important}.auctionResourcePill.hoverSpend{background:#472525!important;box-shadow:0 0 14px rgba(255,107,107,.85)!important;border-color:#ff6b6b!important;color:#fff!important}.auctionResourcePill.flashGainStrong{animation:auctionPillGainStrong .65s ease-in-out 2}.auctionResourcePill.flashSpendStrong{animation:auctionPillSpendStrong .65s ease-in-out 2}@keyframes auctionPillGainStrong{0%,100%{filter:brightness(1)}50%{filter:brightness(1.9);box-shadow:0 0 24px rgba(126,231,135,1)}}@keyframes auctionPillSpendStrong{0%,100%{filter:brightness(1)}50%{filter:brightness(1.9);box-shadow:0 0 24px rgba(255,107,107,1)}}.auctionPost.removing{pointer-events:none}.auctionPost.removing.success{animation:auctionSuccessRemove 1s ease forwards}.auctionPost.removing.expired{animation:auctionExpireRemove 1s ease forwards}@keyframes auctionSuccessRemove{0%{opacity:1;background:#24442b;box-shadow:0 0 18px rgba(126,231,135,.5)}100%{opacity:.08;background:#24442b;box-shadow:0 0 3px rgba(126,231,135,.2)}}@keyframes auctionExpireRemove{0%{opacity:1;background:#472525;box-shadow:0 0 18px rgba(255,107,107,.5)}100%{opacity:.08;background:#472525;box-shadow:0 0 3px rgba(255,107,107,.2)}}.auctionPost.expiringSoon{animation:auctionExpireBlink .65s ease-in-out infinite}@keyframes auctionExpireBlink{0%,100%{box-shadow:0 0 8px rgba(255,107,107,.15);border-color:#3a3a3a}50%{box-shadow:0 0 18px rgba(255,107,107,.85);border-color:#ff6b6b;background:#372222}}.auctionResourcePill.flashGain{animation:auctionPillGain 1s ease}.auctionResourcePill.flashSpend{animation:auctionPillSpend 1s ease}@keyframes auctionPillGain{0%{background:#24442b;box-shadow:0 0 14px rgba(126,231,135,.75);color:#fff}100%{background:#171717;box-shadow:none;color:#cfcfcf}}@keyframes auctionPillSpend{0%{background:#472525;box-shadow:0 0 14px rgba(255,107,107,.75);color:#fff}100%{background:#171717;box-shadow:none;color:#cfcfcf}}
.unlockHint{color:#8fb4ff;font-size:.85em;margin-top:6px}.upgradeToolbar{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin:18px 0 10px}.upgradeTabs{display:flex;gap:8px;margin:0;flex-wrap:wrap}.upgradeTab{padding:9px 13px;background:#333;border:none;color:white;cursor:pointer;border-radius:8px}.upgradeTab.active{background:#6d8cff}.upgradePanel{display:none}.upgradePanel.active{display:block}.emptyText{color:#aaa;font-size:.9em;padding:10px}#upgradePanel_available .emptyText:not(.hidden){min-height:32vh}.settingsButton{position:fixed;top:14px;right:14px;z-index:20;background:#2d2d2d;color:#fff;border:1px solid #555;border-radius:999px;width:38px;height:38px;font-size:18px;box-shadow:0 0 12px rgba(109,140,255,.25)}.settingsPanel{position:fixed;top:60px;right:14px;z-index:20;width:min(340px,calc(100vw - 28px));background:#202020;border:1px solid #444;border-radius:10px;padding:12px;box-shadow:0 0 20px rgba(0,0,0,.55)}.settingsPanel textarea{width:100%;height:120px;box-sizing:border-box;background:#111;color:#eee;border:1px solid #444;border-radius:8px;padding:8px;resize:vertical}.settingsPanel .danger{background:#663030;color:white}.settingsPanel .row{display:flex;gap:8px;flex-wrap:wrap}.settingsPanel .msg{color:var(--accent);font-size:.85em;margin-top:8px;min-height:1em;font-weight:normal}
@media(max-width:720px){
 .titleRow{display:flex!important;flex-direction:column;align-items:center;justify-content:center;gap:8px;min-height:auto;margin-bottom:14px;padding-top:2px}
 .titleRow h1{position:static!important;margin:0!important;text-align:center;font-size:1.45em;line-height:1.2}
 .titleTabs{position:static!important;left:auto!important;top:auto!important;transform:none!important;justify-content:center!important;margin:0!important}
 .mainTab{padding:8px 12px}
}



body::before{content:"";position:fixed;inset:0;background:var(--bg-overlay,transparent);pointer-events:none;z-index:-1}
body.hasCustomBg{--bg-overlay:rgba(0,0,0,.38)}
body.theme-graphite.hasCustomBg,body.theme-solar.hasCustomBg{--bg-overlay:rgba(255,255,255,.42)}
body.theme-graphite .topbar,
body.theme-graphite .card,
body.theme-graphite .upgradeBox,
body.theme-graphite .generatorCard,
body.theme-graphite .upgrade,
body.theme-graphite .auctionPost,
body.theme-graphite .auctionSectionHeader,
body.theme-graphite .settingsPanel,
body.theme-nebula .topbar,body.theme-nebula .card,body.theme-nebula .upgradeBox,body.theme-nebula .generatorCard,body.theme-nebula .upgrade,body.theme-nebula .auctionPost,body.theme-nebula .auctionSectionHeader,body.theme-nebula .settingsPanel,
body.theme-ocean .topbar,body.theme-ocean .card,body.theme-ocean .upgradeBox,body.theme-ocean .generatorCard,body.theme-ocean .upgrade,body.theme-ocean .auctionPost,body.theme-ocean .auctionSectionHeader,body.theme-ocean .settingsPanel,
body.theme-ember .topbar,body.theme-ember .card,body.theme-ember .upgradeBox,body.theme-ember .generatorCard,body.theme-ember .upgrade,body.theme-ember .auctionPost,body.theme-ember .auctionSectionHeader,body.theme-ember .settingsPanel,
body.theme-forest .topbar,body.theme-forest .card,body.theme-forest .upgradeBox,body.theme-forest .generatorCard,body.theme-forest .upgrade,body.theme-forest .auctionPost,body.theme-forest .auctionSectionHeader,body.theme-forest .settingsPanel,
body.theme-royal .topbar,body.theme-royal .card,body.theme-royal .upgradeBox,body.theme-royal .generatorCard,body.theme-royal .upgrade,body.theme-royal .auctionPost,body.theme-royal .auctionSectionHeader,body.theme-royal .settingsPanel,
body.theme-terminal .topbar,body.theme-terminal .card,body.theme-terminal .upgradeBox,body.theme-terminal .generatorCard,body.theme-terminal .upgrade,body.theme-terminal .auctionPost,body.theme-terminal .auctionSectionHeader,body.theme-terminal .settingsPanel,
body.theme-solar .topbar,body.theme-solar .card,body.theme-solar .upgradeBox,body.theme-solar .generatorCard,body.theme-solar .upgrade,body.theme-solar .auctionPost,body.theme-solar .auctionSectionHeader,body.theme-solar .settingsPanel,
body.theme-crimson .topbar,body.theme-crimson .card,body.theme-crimson .upgradeBox,body.theme-crimson .generatorCard,body.theme-crimson .upgrade,body.theme-crimson .auctionPost,body.theme-crimson .auctionSectionHeader,body.theme-crimson .settingsPanel,
body.theme-aurora .topbar,body.theme-aurora .card,body.theme-aurora .upgradeBox,body.theme-aurora .generatorCard,body.theme-aurora .upgrade,body.theme-aurora .auctionPost,body.theme-aurora .auctionSectionHeader,body.theme-aurora .settingsPanel{background:var(--panel)!important;border-color:var(--border)!important;color:var(--text)!important}
body.theme-graphite .generatorCard,body.theme-graphite .upgrade,body.theme-graphite .auctionPost,
body.theme-nebula .generatorCard,body.theme-nebula .upgrade,body.theme-nebula .auctionPost,
body.theme-ocean .generatorCard,body.theme-ocean .upgrade,body.theme-ocean .auctionPost,
body.theme-ember .generatorCard,body.theme-ember .upgrade,body.theme-ember .auctionPost,
body.theme-forest .generatorCard,body.theme-forest .upgrade,body.theme-forest .auctionPost,
body.theme-royal .generatorCard,body.theme-royal .upgrade,body.theme-royal .auctionPost,
body.theme-terminal .generatorCard,body.theme-terminal .upgrade,body.theme-terminal .auctionPost,
body.theme-solar .generatorCard,body.theme-solar .upgrade,body.theme-solar .auctionPost,
body.theme-crimson .generatorCard,body.theme-crimson .upgrade,body.theme-crimson .auctionPost,
body.theme-aurora .generatorCard,body.theme-aurora .upgrade,body.theme-aurora .auctionPost{background:var(--card)!important}
body[class*="theme-"] button,body[class*="theme-"] .tab,body[class*="theme-"] .creditTab,body[class*="theme-"] .upgradeTab,body[class*="theme-"] .mainTab{background:var(--button);color:var(--text);border:1px solid var(--border)}
body[class*="theme-"] .tab.active,body[class*="theme-"] .creditTab.active,body[class*="theme-"] .upgradeTab.active,body[class*="theme-"] .mainTab.active{background:var(--accent);color:white;border-color:var(--accent)}
body[class*="theme-"] .bar{background:var(--input);border-color:var(--border);box-shadow:none}
body[class*="theme-"] .settingsPanel textarea,body[class*="theme-"] .settingsPanel select,body[class*="theme-"] .settingsPanel input[type='url']{background:var(--input);color:var(--text);border:1px solid var(--border)}
body[class*="theme-"] .fixedTopHeader{background:var(--top);border-color:var(--border)}
.bgInput{width:100%;box-sizing:border-box;padding:7px;border-radius:8px;margin-top:6px}

.themeRow{margin:10px 0}.themeRow select{padding:7px;border-radius:8px;background:#111;color:#eee;border:1px solid #444}

body.theme-graphite .fixedTopHeader,
body.theme-graphite .topbar,
body.theme-graphite #fixedResourceHeader,
body.theme-graphite .auctionResourcePill{
  background:#e0e1e4 !important;
  color:#3f454d !important;
  border-color:#b8bcc3 !important;
}
body.theme-graphite .auctionResourcePill.hoverGain{background:#dff5e4!important}
body.theme-graphite .auctionResourcePill.hoverSpend{background:#f8dddd!important}

body.theme-graphite .cost-affordable,
body.theme-graphite .costPart.ok{
  color:#145f2d!important;
  text-shadow:0 1px 0 rgba(255,255,255,.62);
}
body.theme-graphite .barFill.affordable{
  background:#16803a!important;
  box-shadow:0 0 0 1px rgba(8,72,31,.55),0 0 8px rgba(22,128,58,.45)!important;
}
body.theme-solar .cost-affordable,
body.theme-solar .costPart.ok{
  color:#145b2d!important;
  text-shadow:0 1px 0 rgba(255,242,196,.55);
}
body.theme-solar .barFill.affordable{
  background:#176a35!important;
  box-shadow:0 0 0 1px rgba(66,42,9,.42),0 0 8px rgba(23,106,53,.50)!important;
}


/* Themed WebKit scrollbars */
html,body,*{
  scrollbar-color:var(--scroll-thumb) var(--scroll-track);
  scrollbar-width:thin;
}
html::-webkit-scrollbar,
body::-webkit-scrollbar,
*::-webkit-scrollbar{
  width:12px;
  height:12px;
}
html::-webkit-scrollbar-track,
body::-webkit-scrollbar-track,
*::-webkit-scrollbar-track{
  background-color:var(--scroll-track)!important;
  border:1px solid var(--border);
  border-radius:999px;
}
html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb,
*::-webkit-scrollbar-thumb{
  background-color:var(--scroll-thumb)!important;
  border:2px solid var(--scroll-track);
  border-radius:999px;
}
html::-webkit-scrollbar-thumb:hover,
body::-webkit-scrollbar-thumb:hover,
*::-webkit-scrollbar-thumb:hover{
  background-color:var(--scroll-thumb-hover)!important;
}
html::-webkit-scrollbar-corner,
body::-webkit-scrollbar-corner,
*::-webkit-scrollbar-corner{
  background-color:var(--scroll-track)!important;
}

/* Compact top header + slide-out inventory */
.headerShell{
  position:fixed;
  top:0;
  left:0;
  right:0;
  z-index:15;
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:center;
  gap:10px;
  background:var(--top);
  border-bottom:1px solid var(--border);
  box-shadow:none;
  box-sizing:border-box;
  min-height:64px;
  padding:10px 14px;
}
.fixedTopHeader{
  position:static!important;
  max-height:none!important;
  overflow:visible!important;
  background:transparent!important;
  border-bottom:0!important;
  box-shadow:none!important;
  padding:0!important;
}
.headerSummary{
  display:flex;
  align-items:center;
  gap:4px;
  flex-wrap:wrap;
  min-width:0;
}
.headerSummary .auctionResourcePill{
  margin:0;
  font-size:.9em;
  min-width:180px;
  box-sizing:border-box;
  font-variant-numeric:tabular-nums;
  font-feature-settings:"tnum";
}
.headerActions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:8px;
  flex-wrap:nowrap;
}
.headerActions button{
  margin-top:0!important;
}
.headerSettingsColumn{
  display:none!important;
}
.inventoryButton,
.headerActions .settingsButton{
  position:static!important;
  top:auto!important;
  right:auto!important;
  width:auto!important;
  height:auto!important;
  min-height:36px;
  border-radius:999px;
  padding:7px 12px!important;
  font-size:14px!important;
  line-height:1.2!important;
  margin:0!important;
  z-index:21;
}
.inventoryOverlay{
  position:fixed;
  inset:0;
  z-index:24;
  background:rgba(0,0,0,.45);
  opacity:0;
  pointer-events:none;
  transition:opacity .18s ease;
}
.inventoryOverlay.open{
  opacity:1;
  pointer-events:auto;
}
.inventoryPanel{
  position:fixed;
  top:0;
  right:0;
  z-index:25;
  width:min(390px,calc(100vw - 22px));
  height:100vh;
  box-sizing:border-box;
  background:var(--panel);
  color:var(--text);
  border-left:1px solid var(--border);
  box-shadow:-12px 0 30px rgba(0,0,0,.45);
  transform:translateX(105%);
  transition:transform .2s ease;
  display:flex;
  flex-direction:column;
}
.inventoryPanel.open{
  transform:translateX(0);
}
.inventoryHeader{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:14px;
  border-bottom:1px solid var(--border);
}
.inventoryHeader h3{
  margin:0;
}
.inventoryClose{
  margin-top:0!important;
  width:32px;
  height:32px;
  padding:0!important;
  font-size:18px;
  line-height:1;
}
.inventoryContent{
  padding:12px;
  overflow:auto;
}
.inventoryGrid{
  display:grid;
  grid-template-columns:1fr;
  gap:7px;
}
.inventoryGrid .auctionResourcePill{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  border-radius:8px;
  padding:8px 10px;
  font-size:.9em;
}
.inventoryGrid .inventoryAmount{
  font-weight:bold;
  text-align:right;
  white-space:nowrap;
}
.settingsPanel{
  right:14px;
  top:72px;
}
@media(max-width:720px){
  body{padding-top:112px;scroll-padding-top:112px}
  .headerShell{grid-template-columns:1fr;align-items:start}
  .headerActions{justify-content:flex-start;flex-wrap:wrap}
  .titleTabs{position:static!important;left:auto!important;top:auto!important;transform:none!important;justify-content:center!important;margin:0!important}
}

.statsControls{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-bottom:12px}
.statsGrid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:10px}
.statsCard{background:var(--card);border:1px solid var(--border);border-radius:10px;padding:10px}
.statsCard h3{margin:0 0 8px}
.statLine{display:flex;justify-content:space-between;gap:12px;border-top:1px solid var(--border);padding:5px 0;font-size:.9em}
.statLine:first-of-type{border-top:0}
.statLabel{color:var(--muted)}
.statValue{font-weight:bold;text-align:right}
.achievementSummary{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}
.achievementBadge{display:inline-flex;align-items:center;border:1px solid var(--border);background:var(--card);border-radius:999px;padding:5px 9px;font-size:.9em;font-weight:bold}
.achievementGrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:12px;align-items:stretch}
.achievementCard{background:var(--card);border:1px solid var(--border);border-radius:8px;padding:12px;min-height:142px;box-sizing:border-box;display:flex;flex-direction:column;justify-content:space-between;gap:10px}
.achievementCard.locked{opacity:.72}
.achievementCard.unlocked{border-color:var(--accent)}
.achievementCardTop{display:flex;align-items:flex-start;gap:9px}
.achievementIcon{width:26px;height:26px;flex:0 0 26px;border:1px solid var(--border);border-radius:6px;display:inline-flex;align-items:center;justify-content:center;font-weight:bold;background:var(--panel);box-sizing:border-box}
.achievementCard.unlocked .achievementIcon{background:var(--accent);border-color:var(--accent);color:#fff}
.achievementTitle{font-weight:bold;line-height:1.2}
.achievementDesc{color:var(--muted);font-size:.9em;line-height:1.35;flex:1}
.achievementCardFooter{display:flex;align-items:center;justify-content:space-between;gap:8px;border-top:1px solid var(--border);padding-top:8px;font-size:.84em}
.achievementStatus{font-weight:bold;color:var(--muted)}
.achievementCard.unlocked .achievementStatus{color:var(--accent)}
.achievementReward{color:var(--good);font-weight:bold;text-align:right}


/* Minimal monochrome CSS resource icons */
.resIcon{
  width:.9em;
  height:.9em;
  display:inline-block;
  vertical-align:-.12em;
  margin-right:.32em;
  position:relative;
  box-sizing:border-box;
  color:currentColor;
  opacity:.78;
  flex:0 0 auto;
}
.resIcon::before,
.resIcon::after{
  content:"";
  position:absolute;
  box-sizing:border-box;
  border-color:currentColor;
}
.resIcon.credits::before{inset:.08em;border:.12em solid currentColor;border-radius:50%}
.resIcon.credits::after{inset:.36em;background:currentColor;border-radius:50%}

.resIcon.ore::before{inset:.16em;border:.12em solid currentColor;transform:rotate(45deg);border-radius:.08em}
.resIcon.crystal::before{left:.28em;top:.04em;width:.34em;height:.78em;border:.12em solid currentColor;clip-path:polygon(50% 0,100% 25%,82% 100%,18% 100%,0 25%)}
.resIcon.metal::before{left:.12em;right:.12em;top:.26em;height:.38em;border:.12em solid currentColor;border-radius:.08em;transform:skew(-12deg)}
.resIcon.silicon::before,.resIcon.data::before{inset:.12em;border:.1em solid currentColor;border-radius:.12em}
.resIcon.silicon::after,.resIcon.data::after{left:.22em;right:.22em;top:.43em;border-top:.1em solid currentColor;box-shadow:0 -.22em 0 -.02em currentColor,0 .22em 0 -.02em currentColor}
.resIcon.copper::before{inset:.15em;border:.12em solid currentColor;border-radius:50%}
.resIcon.copper::after{left:.42em;top:.05em;height:.8em;border-left:.11em solid currentColor}
.resIcon.titanium::before{left:.16em;right:.16em;top:.16em;height:.58em;border:.12em solid currentColor;border-radius:.08em;transform:rotate(-8deg)}

.resIcon.gas::before{left:.08em;top:.22em;width:.36em;height:.36em;border:.11em solid currentColor;border-radius:50%}
.resIcon.gas::after{right:.08em;bottom:.18em;width:.42em;height:.42em;border:.11em solid currentColor;border-radius:50%}
.resIcon.water::before{left:.24em;top:.04em;width:.42em;height:.76em;border:.12em solid currentColor;border-radius:60% 60% 65% 65%;transform:rotate(45deg)}
.resIcon.food::before{inset:.14em;border:.12em solid currentColor;border-radius:50% 50% 45% 45%}
.resIcon.biomass::before,.resIcon.genes::before{left:.18em;top:.12em;width:.54em;height:.66em;border:.11em solid currentColor;border-radius:50% 0 50% 0;transform:rotate(-25deg)}
.resIcon.medicine::before{left:.39em;top:.12em;height:.66em;border-left:.12em solid currentColor}
.resIcon.medicine::after{left:.12em;top:.39em;width:.66em;border-top:.12em solid currentColor}

.resIcon.science::before{left:.25em;top:.1em;width:.4em;height:.68em;border:.11em solid currentColor;border-top:0;border-radius:0 0 .25em .25em}
.resIcon.science::after{left:.18em;top:.06em;width:.54em;border-top:.11em solid currentColor}
.resIcon.nano::before{inset:.38em;background:currentColor;border-radius:50%;box-shadow:-.26em -.18em 0 -.02em currentColor,.26em -.18em 0 -.02em currentColor,0 .3em 0 -.02em currentColor}
.resIcon.algorithms::before,.resIcon.robotics::before{inset:.14em;border:.11em solid currentColor;border-radius:.12em}
.resIcon.algorithms::after,.resIcon.robotics::after{left:.26em;top:.26em;width:.38em;height:.38em;border:.1em solid currentColor;border-radius:50%}
.resIcon.fusion::before,.resIcon.plasma::before{left:.18em;top:.18em;width:.52em;height:.52em;border:.11em solid currentColor;border-radius:50%;box-shadow:0 0 0 .08em transparent}.resIcon.fusion::after,.resIcon.plasma::after{left:.05em;top:.43em;width:.8em;border-top:.11em solid currentColor;transform:rotate(-35deg);box-shadow:0 0 0 0 currentColor,0 0 0 0 currentColor}

.resIcon.darkmatter::before,.resIcon.void::before,.resIcon.singularity::before{inset:.08em;border:.12em solid currentColor;border-radius:50%}
.resIcon.darkmatter::after,.resIcon.void::after,.resIcon.singularity::after{inset:.32em;background:currentColor;border-radius:50%}
.resIcon.antimatter::before,.resIcon.quantum::before{inset:.16em;border:.1em solid currentColor;border-radius:50%;transform:rotate(25deg) scaleX(1.35)}
.resIcon.antimatter::after,.resIcon.quantum::after{inset:.16em;border:.1em solid currentColor;border-radius:50%;transform:rotate(-35deg) scaleX(1.35)}
.resIcon.neutronium::before{inset:.15em;border:.12em solid currentColor;border-radius:.08em}

.resIcon.starlight::before,.resIcon.solaris::before,.resIcon.pulsar::before,.resIcon.supernova::before{inset:.09em;background:currentColor;clip-path:polygon(50% 0,151% 35%,98% 35%,68% 57%,79% 94%,50% 72%,21% 94%,32% 57%,2% 35%,39% 35%)}
.resIcon.nebula::before{inset:.14em;border:.12em solid currentColor;border-radius:55% 45% 60% 40%}
.resIcon.comet::before{right:.1em;top:.14em;width:.34em;height:.34em;border:.11em solid currentColor;border-radius:50%}
.resIcon.comet::after{left:.08em;top:.48em;width:.44em;border-top:.11em solid currentColor;transform:rotate(-20deg)}

.resIcon.galaxycore::before,.resIcon.warp::before,.resIcon.subspace::before,.resIcon.chronos::before,.resIcon.aether::before{inset:.08em;border:.11em solid currentColor;border-radius:50%}
.resIcon.galaxycore::after,.resIcon.warp::after,.resIcon.subspace::after,.resIcon.chronos::after,.resIcon.aether::after{left:.12em;right:.12em;top:.43em;border-top:.1em solid currentColor;transform:rotate(-25deg)}

.resIcon.essence::before,.resIcon.relic::before,.resIcon.mythic::before,.resIcon.celestial::before,.resIcon.divinity::before,.resIcon.transcendence::before{inset:.12em;border:.11em solid currentColor;border-radius:50%;transform:rotate(45deg)}
.resIcon.infinity::before,.resIcon.eternity::before{left:.08em;right:.08em;top:.26em;height:.38em;border:.11em solid currentColor;border-radius:50%;transform:scaleX(1.25)}
.resIcon.paradox::before{inset:.12em;border:.11em solid currentColor;border-left-color:transparent;border-right-color:transparent;border-radius:50%}
.resIcon.omni::before,.resIcon.genesis::before,.resIcon.omega::before{inset:.12em;border:.11em solid currentColor;transform:rotate(45deg);border-radius:.06em}
.resIcon.generic::before{inset:.16em;border:.11em solid currentColor;border-radius:.1em}

.resLabel{display:inline-flex;align-items:center;gap:.05em}
.resourceTitle{display:flex;align-items:center;gap:.12em;flex-wrap:wrap}
.auctionResourcePill .resIcon{width:.82em;height:.82em;margin-right:.24em;opacity:.72}
.auctionTitle .resIcon,.statsCard h3 .resIcon{width:.95em;height:.95em}
button .resIcon{width:.85em;height:.85em}


.generatorCard,.statsCard,.auctionPost{position:relative}
.cornerResIcon{
 position:absolute;
 top:10px;
 left:10px;
 right:auto;
 width:1em;
 height:1em;
 margin:0;
 opacity:.72;
 pointer-events:none;
}
.resourceTitle .resIcon{display:none!important}
.generatorCard,.statsCard,.auctionPost{padding-left:34px!important}
.generatorCard h3,.statsCard h3,.auctionPost .auctionTitle{padding-left:0;margin-left:0}
.auctionPost .cornerResIcon{top:11px;left:10px}


body.iconsDisabled .resIcon{display:none!important}
body.iconsDisabled .generatorCard,
body.iconsDisabled .statsCard,
body.iconsDisabled .auctionPost{padding-left:12px!important}


.costPart{font-weight:bold}
.costPart.ok{color:#7ee787!important}
.costPart.no{color:#ff6b6b!important}


/* Disable text selection in the game UI, except Settings copy/paste fields */
body,
body *{
  -webkit-user-select:none;
  -moz-user-select:none;
  -ms-user-select:none;
  user-select:none;
}
.settingsPanel textarea,
.settingsPanel textarea *,
.settingsPanel input,
.settingsPanel input *,
.settingsPanel select,
.settingsPanel select *,
#saveBox{
  -webkit-user-select:text!important;
  -moz-user-select:text!important;
  -ms-user-select:text!important;
  user-select:text!important;
}


/* Windows 95/98 theme */
body.theme-win98{
  background-color:#c0c0c0!important;
  color:#000!important;
}
body.theme-win98 .fixedTopHeader,
body.theme-win98 .headerShell,
body.theme-win98 .headerSettingsColumn,
body.theme-win98 .topbar,
body.theme-win98 .card,
body.theme-win98 .upgradeBox,
body.theme-win98 .generatorCard,
body.theme-win98 .upgrade,
body.theme-win98 .auctionPost,
body.theme-win98 .auctionSectionHeader,
body.theme-win98 .settingsPanel,
body.theme-win98 .statsCard,
body.theme-win98 .achievementCard,
body.theme-win98 .achievementBadge{
  background:#c0c0c0!important;
  color:#000!important;
  border-top:2px solid #fff!important;
  border-left:2px solid #fff!important;
  border-right:2px solid #404040!important;
  border-bottom:2px solid #404040!important;
  border-radius:0!important;
  box-shadow:none!important;
}
body.theme-win98 .generatorCard,
body.theme-win98 .upgrade,
body.theme-win98 .auctionPost,
body.theme-win98 .statsCard,
body.theme-win98 .achievementCard,
body.theme-win98 .achievementBadge{
  background:#d4d0c8!important;
}
body.theme-win98 button,
body.theme-win98 .tab,
body.theme-win98 .creditTab,
body.theme-win98 .upgradeTab,
body.theme-win98 .mainTab{
  background:#c0c0c0!important;
  color:#000!important;
  border-top:2px solid #fff!important;
  border-left:2px solid #fff!important;
  border-right:2px solid #404040!important;
  border-bottom:2px solid #404040!important;
  border-radius:0!important;
  box-shadow:none!important;
  font-family:"MS Sans Serif",Tahoma,Verdana,sans-serif!important;
}
body.theme-win98 button:active,
body.theme-win98 .tab:active,
body.theme-win98 .creditTab:active,
body.theme-win98 .upgradeTab:active,
body.theme-win98 .mainTab:active{
  border-top:2px solid #404040!important;
  border-left:2px solid #404040!important;
  border-right:2px solid #fff!important;
  border-bottom:2px solid #fff!important;
}
body.theme-win98 .tab.active,
body.theme-win98 .creditTab.active,
body.theme-win98 .upgradeTab.active,
body.theme-win98 .mainTab.active{
  background:#000080!important;
  color:#fff!important;
  border-color:#000080!important;
}
body.theme-win98 input,
body.theme-win98 textarea,
body.theme-win98 select,
body.theme-win98 .auctionSearch,
body.theme-win98 .bgInput{
  background:#fff!important;
  color:#000!important;
  border-top:2px solid #404040!important;
  border-left:2px solid #404040!important;
  border-right:2px solid #fff!important;
  border-bottom:2px solid #fff!important;
  border-radius:0!important;
  box-shadow:none!important;
}
body.theme-win98 .bar{
  background:#fff!important;
  border-top:2px solid #404040!important;
  border-left:2px solid #404040!important;
  border-right:2px solid #fff!important;
  border-bottom:2px solid #fff!important;
  border-radius:0!important;
}
body.theme-win98 .barFill.affordable{background:#0b6a0b!important;box-shadow:none!important}
body.theme-win98 .barFill.unaffordable{background:#800000!important;box-shadow:none!important}
body.theme-win98 .auctionResourcePill{
  background:#d4d0c8!important;
  color:#000!important;
  border-top:1px solid #fff!important;
  border-left:1px solid #fff!important;
  border-right:1px solid #404040!important;
  border-bottom:2px solid #404040!important;
  border-radius:0!important;
}
body.theme-win98 .settingsButton{
  width:38px!important;
  height:34px!important;
  border-radius:0!important;
}
body.theme-win98 h1,
body.theme-win98 h2,
body.theme-win98 h3{
  font-family:"MS Sans Serif",Tahoma,Verdana,sans-serif!important;
}
body.theme-win98 ::-webkit-scrollbar{width:16px;height:16px}
body.theme-win98 ::-webkit-scrollbar-track{background:#c0c0c0!important;border-radius:0!important}
body.theme-win98 ::-webkit-scrollbar-thumb{
  background:#dfdfdf!important;
  border-top:2px solid #fff!important;
  border-left:2px solid #fff!important;
  border-right:2px solid #404040!important;
  border-bottom:2px solid #404040!important;
  border-radius:0!important;
}


body.theme-win98 .costPart.ok,
body.theme-win98 .cost-affordable{
  color:#0b6a0b!important;
}


body.theme-win98 .auctionMeta,
body.theme-win98 .small{
  color:#5a5a5a!important;
}

body.theme-win98 .settingsPanel .msg{
  color:#000080!important;
  font-weight:normal!important;
}


/* Owned upgrade cost text should stay white */
.cost.cost-purchased,
.cost.cost-purchased .costPart,
.cost.cost-purchased .costPart.ok,
.cost.cost-purchased .costPart.no,
.cost.cost-purchased .resLabel,
.cost.cost-purchased .resIcon{
  color:#fff!important;
}

/* In Old School theme, owned upgrade costs should be grey instead of white */
body.theme-win98 .cost.cost-purchased,
body.theme-win98 .cost.cost-purchased .costPart,
body.theme-win98 .cost.cost-purchased .costPart.ok,
body.theme-win98 .cost.cost-purchased .costPart.no,
body.theme-win98 .cost.cost-purchased .resLabel,
body.theme-win98 .cost.cost-purchased .resIcon{
  color:#404040!important;
}


/* Old School Auction House 0-5 second expiry warning */
body.theme-win98 .auctionPost.expiringSoon:not(.removing){
  background:#d4d0c8!important;
}
body.theme-win98 .auctionPost.expiringSoon.expiryBlinkOn:not(.removing){
  background:#e79a9a!important;
  border-right-color:#800000!important;
  border-bottom-color:#800000!important;
}
body.theme-win98 .auctionPost.expiringSoon:not(.removing) .auctionMeta,
body.theme-win98 .auctionPost.expiringSoon:not(.removing) .small{
  color:#303030!important;
}








/* Theme-colored fixed header resource pills */
body:not(.theme-win98) #inventoryResources .auctionResourcePill{
  background:var(--panel)!important;
  color:var(--text)!important;
  border:1px solid var(--border)!important;
}


/* Old School: thin sticky header only.
   This is inside <style>, so it overrides the global 2px Win98 bevel rules. */
body.theme-win98 .headerShell,
body.theme-win98 .fixedTopHeader,
body.theme-win98 #fixedResourceHeader,
body.theme-win98 .fixedTopHeader .topbar,
body.theme-win98 #fixedResourceHeader .topbar,
body.theme-win98 .headerSettingsColumn{
  border-top-width:1.5px !important;
  border-left-width:1.5px !important;
  border-right-width:1.5px !important;
  border-bottom-width:1.5px !important;
}

/* Specifically force the bottom edge that looked thick */
body.theme-win98 .fixedTopHeader{
  border-bottom:1.5px solid #404040 !important;
}


/* Old School: use 1px borders throughout the sticky header area */
body.theme-win98 .headerShell,
body.theme-win98 .fixedTopHeader,
body.theme-win98 #fixedResourceHeader,
body.theme-win98 .fixedTopHeader .topbar,
body.theme-win98 #fixedResourceHeader .topbar,
body.theme-win98 .headerSettingsColumn{
  border-top-width:1px !important;
  border-left-width:1px !important;
  border-right-width:1px !important;
  border-bottom-width:1px !important;
}

body.theme-win98 .fixedTopHeader{
  border-bottom:1px solid #404040 !important;
}

body.theme-win98 #inventoryResources .auctionResourcePill{
  border-top:1px solid #fff !important;
  border-left:1px solid #fff !important;
  border-right:1px solid #404040 !important;
  border-bottom:1px solid #404040 !important;
}


/* Theme-aware text color fixes
   - Auction House rate/meta text follows each theme instead of hardcoded grey.
   - Owned upgrade Bought status is brighter on normal themes.
   - Purchased upgrade costs use a neutral theme color, not white/red/green.
   Old School keeps its classic grey styling. */
body:not(.theme-win98) .auctionMeta{
  color:var(--muted)!important;
}

body:not(.theme-win98) .upgrade .bought,
body:not(.theme-win98) #upgradePanels .bought{
  color:var(--accent)!important;
  font-weight:bold;
}

body:not(.theme-win98) .cost.cost-purchased,
body:not(.theme-win98) .cost.cost-purchased .costPart,
body:not(.theme-win98) .cost.cost-purchased .costPart.ok,
body:not(.theme-win98) .cost.cost-purchased .costPart.no,
body:not(.theme-win98) .cost.cost-purchased .resLabel,
body:not(.theme-win98) .cost.cost-purchased .resIcon{
  color:var(--muted)!important;
}

body.theme-win98 .auctionMeta{
  color:#5a5a5a!important;
}

body.theme-win98 .upgrade .bought,
body.theme-win98 #upgradePanels .bought{
  color:#0b6a0b!important;
  font-weight:bold;
}

body.theme-win98 .cost.cost-purchased,
body.theme-win98 .cost.cost-purchased .costPart,
body.theme-win98 .cost.cost-purchased .costPart.ok,
body.theme-win98 .cost.cost-purchased .costPart.no,
body.theme-win98 .cost.cost-purchased .resLabel,
body.theme-win98 .cost.cost-purchased .resIcon{
  color:#404040!important;
}

body.theme-win98 .achievementBadge{
  border-radius:0!important;
  font-weight:normal!important;
}

body.theme-win98 .achievementIcon{
  background:#c0c0c0!important;
  color:#000!important;
  border-top:2px solid #fff!important;
  border-left:2px solid #fff!important;
  border-right:2px solid #404040!important;
  border-bottom:2px solid #404040!important;
  border-radius:0!important;
}

body.theme-win98 .achievementCard.unlocked{
  border-top:2px solid #fff!important;
  border-left:2px solid #fff!important;
  border-right:2px solid #404040!important;
  border-bottom:2px solid #404040!important;
}

body.theme-win98 .achievementCard.unlocked .achievementIcon{
  background:#000080!important;
  color:#fff!important;
  border-color:#000080!important;
}

body.theme-win98 .achievementDesc,
body.theme-win98 .achievementStatus{
  color:#5a5a5a!important;
}

body.theme-win98 .achievementCard.unlocked .achievementStatus{
  color:#000080!important;
}

body.theme-win98 .achievementReward{
  color:#0b6a0b!important;
}


/* Fixed top header resources:
   Keep red/green hover highlighting, but suppress click-complete blink/flash animations. */
#inventoryResources .auctionResourcePill.flashGain,
#inventoryResources .auctionResourcePill.flashSpend,
#inventoryResources .auctionResourcePill.flashGainStrong,
#inventoryResources .auctionResourcePill.flashSpendStrong{
  animation:none!important;
  filter:none!important;
}
#inventoryResources .auctionResourcePill.flashGain:not(.hoverGain):not(.hoverSpend),
#inventoryResources .auctionResourcePill.flashGainStrong:not(.hoverGain):not(.hoverSpend),
#inventoryResources .auctionResourcePill.flashSpend:not(.hoverGain):not(.hoverSpend),
#inventoryResources .auctionResourcePill.flashSpendStrong:not(.hoverGain):not(.hoverSpend){
  background:var(--panel)!important;
  color:var(--text)!important;
  border-color:var(--border)!important;
  box-shadow:none!important;
}
body.theme-win98 #inventoryResources .auctionResourcePill.flashGain:not(.hoverGain):not(.hoverSpend),
body.theme-win98 #inventoryResources .auctionResourcePill.flashGainStrong:not(.hoverGain):not(.hoverSpend),
body.theme-win98 #inventoryResources .auctionResourcePill.flashSpend:not(.hoverGain):not(.hoverSpend),
body.theme-win98 #inventoryResources .auctionResourcePill.flashSpendStrong:not(.hoverGain):not(.hoverSpend){
  background:#d4d0c8!important;
  color:#000!important;
  border-top:1px solid #fff!important;
  border-left:1px solid #fff!important;
  border-right:1px solid #404040!important;
  border-bottom:1px solid #404040!important;
  box-shadow:none!important;
}





/* Disabled upgrade/generator buttons still need hover events for cost-preview pills. */
button:disabled{
  pointer-events:auto;
}


/* Upgrade hover preview should work even when the button says "Can't afford yet". */
.upgrade[data-upgrade-index]{
  pointer-events:auto;
}
.upgrade[data-upgrade-index] button:disabled{
  pointer-events:none;
}


/* Upgrade card hover preview: disabled buttons should not block the card hover. */
.upgrade button:disabled{
  pointer-events:none;
}


/* Smooth upgrade loading bars, including "Can't afford yet" upgrade cards. */
#upgradePanels .barFill{
  width:100%!important;
  transform-origin:left center!important;
  transition:transform .18s linear, background .12s ease, box-shadow .12s ease!important;
  will-change:transform;
}


/* Strong Windows 95/98 scrollbars for Old School theme */
body.theme-win98,
body.theme-win98 *{
  scrollbar-color:#808080 #c0c0c0!important;
  scrollbar-width:auto!important;
}

body.theme-win98::-webkit-scrollbar,
body.theme-win98 *::-webkit-scrollbar{
  width:16px!important;
  height:16px!important;
}

body.theme-win98::-webkit-scrollbar-track,
body.theme-win98 *::-webkit-scrollbar-track{
  background:#c0c0c0!important;
  border-top:1px solid #808080!important;
  border-left:1px solid #808080!important;
  border-right:1px solid #ffffff!important;
  border-bottom:1px solid #ffffff!important;
  border-radius:0!important;
}

body.theme-win98::-webkit-scrollbar-thumb,
body.theme-win98 *::-webkit-scrollbar-thumb{
  background:#c0c0c0!important;
  border-top:2px solid #ffffff!important;
  border-left:2px solid #ffffff!important;
  border-right:2px solid #404040!important;
  border-bottom:2px solid #404040!important;
  border-radius:0!important;
  box-shadow:inset 1px 1px 0 #dfdfdf,inset -1px -1px 0 #808080!important;
}

body.theme-win98::-webkit-scrollbar-thumb:hover,
body.theme-win98 *::-webkit-scrollbar-thumb:hover{
  background:#dfdfdf!important;
}

body.theme-win98::-webkit-scrollbar-corner,
body.theme-win98 *::-webkit-scrollbar-corner{
  background:#c0c0c0!important;
  border-radius:0!important;
}

body.theme-win98::-webkit-scrollbar-button,
body.theme-win98 *::-webkit-scrollbar-button{
  width:16px!important;
  height:16px!important;
  background:#c0c0c0!important;
  border-top:2px solid #ffffff!important;
  border-left:2px solid #ffffff!important;
  border-right:2px solid #404040!important;
  border-bottom:2px solid #404040!important;
  border-radius:0!important;
}

body.theme-win98::-webkit-scrollbar-button:active,
body.theme-win98 *::-webkit-scrollbar-button:active{
  border-top:2px solid #404040!important;
  border-left:2px solid #404040!important;
  border-right:2px solid #ffffff!important;
  border-bottom:2px solid #ffffff!important;
}

body.theme-win98::-webkit-scrollbar-button:vertical:decrement,
body.theme-win98 *::-webkit-scrollbar-button:vertical:decrement{
  background:
    linear-gradient(45deg, transparent 50%, #000 50%) 5px 7px/5px 5px no-repeat,
    linear-gradient(135deg, #000 50%, transparent 50%) 8px 7px/5px 5px no-repeat,
    #c0c0c0!important;
}
body.theme-win98::-webkit-scrollbar-button:vertical:increment,
body.theme-win98 *::-webkit-scrollbar-button:vertical:increment{
  background:
    linear-gradient(225deg, transparent 50%, #000 50%) 5px 4px/5px 5px no-repeat,
    linear-gradient(315deg, #000 50%, transparent 50%) 8px 4px/5px 5px no-repeat,
    #c0c0c0!important;
}
body.theme-win98::-webkit-scrollbar-button:horizontal:decrement,
body.theme-win98 *::-webkit-scrollbar-button:horizontal:decrement{
  background:
    linear-gradient(135deg, transparent 50%, #000 50%) 7px 5px/5px 5px no-repeat,
    linear-gradient(45deg, #000 50%, transparent 50%) 7px 8px/5px 5px no-repeat,
    #c0c0c0!important;
}
body.theme-win98::-webkit-scrollbar-button:horizontal:increment,
body.theme-win98 *::-webkit-scrollbar-button:horizontal:increment{
  background:
    linear-gradient(315deg, transparent 50%, #000 50%) 4px 5px/5px 5px no-repeat,
    linear-gradient(225deg, #000 50%, transparent 50%) 4px 8px/5px 5px no-repeat,
    #c0c0c0!important;
}


/* Entire page scrollbar for Old School theme */
html.theme-win98{
  scrollbar-color:#808080 #c0c0c0!important;
  scrollbar-width:auto!important;
}
html.theme-win98::-webkit-scrollbar{
  width:17px!important;
  height:17px!important;
}
html.theme-win98::-webkit-scrollbar-track{
  background:#c0c0c0!important;
  border:none!important;
  border-radius:0!important;
}
html.theme-win98::-webkit-scrollbar-thumb{
  background:#c0c0c0!important;
  border-top:2px solid #ffffff!important;
  border-left:2px solid #ffffff!important;
  border-right:2px solid #808080!important;
  border-bottom:2px solid #808080!important;
  border-radius:0!important;
  box-shadow:none!important;
  min-height:24px!important;
}
html.theme-win98::-webkit-scrollbar-button{
  width:17px!important;
  height:17px!important;
  background:#c0c0c0!important;
  border-top:2px solid #ffffff!important;
  border-left:2px solid #ffffff!important;
  border-right:2px solid #808080!important;
  border-bottom:2px solid #808080!important;
  border-radius:0!important;
}


/* Generator buy buttons must remain visible after Ascension reset */
.generatorCard > button[id^="buy_"],
.generatorCard > button[id^="buy_credit_"]{
  display:inline-block!important;
  visibility:visible!important;
}



/* Header resource pins */
.headerSummary .auctionResourcePill{
  background:var(--panel)!important;
  color:var(--text)!important;
  border:1px solid var(--border)!important;
}
body.theme-win98 .headerSummary .auctionResourcePill{
  background:#d4d0c8!important;
  color:#000!important;
  border-top:1px solid #fff!important;
  border-left:1px solid #fff!important;
  border-right:1px solid #404040!important;
  border-bottom:1px solid #404040!important;
}
.inventoryRowLeft{
  display:flex;
  align-items:center;
  gap:6px;
  min-width:0;
}
.inventoryPinButton{
  margin:0!important;
  width:26px!important;
  height:26px!important;
  min-height:26px!important;
  padding:0!important;
  border-radius:6px!important;
  font-size:13px!important;
  line-height:1!important;
  opacity:.75;
}
.inventoryPinButton.pinned{
  opacity:1;
  font-weight:bold;
}
.inventoryPinButton:disabled{
  opacity:.35;
}
.inventoryHint{
  color:var(--muted);
  font-size:.85em;
  margin-bottom:10px;
}

/* Final compact-header overrides */
.headerShell{
  min-height:64px!important;
  max-height:none!important;
  overflow:visible!important;
}
body{
  padding-top:86px!important;
  scroll-padding-top:86px!important;
}
body.theme-win98 .headerShell,
body.theme-win98 .fixedTopHeader{
  border-top-width:1px!important;
  border-left-width:1px!important;
  border-right-width:1px!important;
  border-bottom-width:1px!important;
}
body.theme-win98 .inventoryPanel,
body.theme-win98 .inventoryHeader,
body.theme-win98 .inventoryGrid .auctionResourcePill{
  border-radius:0!important;
}
@media(max-width:720px){
  body{
    padding-top:112px!important;
    scroll-padding-top:112px!important;
  }
}


/* Fix Old School top action buttons */
body.theme-win98 .headerActions .settingsButton,
body.theme-win98 .headerActions .inventoryButton{
  width:auto!important;
  min-width:auto!important;
  height:auto!important;
  min-height:36px!important;
  padding:7px 12px!important;
  font-size:14px!important;
  line-height:1.2!important;
  white-space:nowrap!important;
  overflow:visible!important;
  border-radius:0!important;
}
body.theme-win98 .headerActions .settingsButton{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
}


.inventoryPinButton{
  pointer-events:auto!important;
  cursor:pointer!important;
  flex:0 0 auto;
}
.inventoryPinButton:disabled{
  cursor:not-allowed!important;
}


.inventoryGrid .inventoryPinButton:not(:disabled){
  pointer-events:auto!important;
  cursor:pointer!important;
  position:relative;
  z-index:5;
}
.inventoryGrid .inventoryPinButton.pinned{
  color:var(--accent)!important;
}
body.theme-win98 .inventoryGrid .inventoryPinButton.pinned{
  color:#000080!important;
}


/* Header background should match main card / Credit Generators background */
.headerShell{
  background:var(--panel)!important;
}
.headerActions{
  background:var(--panel)!important;
}
.fixedTopHeader{
  background:transparent!important;
}
body.theme-win98 .headerShell,
body.theme-win98 .headerActions{
  background:#c0c0c0!important;
}


/* No glow on Settings / Inventory buttons */
.settingsButton,
.inventoryButton,
.headerActions .settingsButton,
.headerActions .inventoryButton{
  box-shadow:none!important;
  text-shadow:none!important;
  filter:none!important;
  outline:none!important;
}
.settingsButton:hover,
.inventoryButton:hover,
.headerActions .settingsButton:hover,
.headerActions .inventoryButton:hover,
.settingsButton:focus,
.inventoryButton:focus,
.headerActions .settingsButton:focus,
.headerActions .inventoryButton:focus{
  box-shadow:none!important;
  text-shadow:none!important;
  filter:none!important;
  outline:none!important;
}


/* Header background matches Credit Generators panel */
.headerShell,
.headerActions{
  background:var(--panel)!important;
}
.fixedTopHeader{
  background:transparent!important;
}


/* Pinned inventory buttons must remain clickable so they can be unpinned */
.inventoryPinButton.pinned:not(:disabled){
  pointer-events:auto!important;
  cursor:pointer!important;
}


/* Inventory pin buttons: Credits, Ascension Cores, and resources can all toggle on/off */
.inventoryPinButton:not(:disabled){
  pointer-events:auto!important;
  cursor:pointer!important;
  opacity:1!important;
}
.inventoryPinButton.pinned:not(:disabled){
  color:var(--accent)!important;
}


/* Final pin/header fixes */
.inventoryPinButton:not(:disabled){
  pointer-events:auto!important;
  cursor:pointer!important;
  opacity:1!important;
  position:relative;
  z-index:50;
}
.inventoryPinButton.pinned:not(:disabled){
  color:var(--accent)!important;
  font-weight:bold!important;
}
.settingsButton,
.inventoryButton,
.headerActions .settingsButton,
.headerActions .inventoryButton,
.settingsButton:hover,
.inventoryButton:hover,
.headerActions .settingsButton:hover,
.headerActions .inventoryButton:hover,
.settingsButton:focus,
.inventoryButton:focus,
.headerActions .settingsButton:focus,
.headerActions .inventoryButton:focus{
  box-shadow:none!important;
  text-shadow:none!important;
  filter:none!important;
  outline:none!important;
}
.headerShell,
.headerActions{
  background:var(--panel)!important;
}
.fixedTopHeader{
  background:transparent!important;
}


/* Row-based header pinning */
.inventoryPinRow{
  cursor:pointer!important;
  pointer-events:auto!important;
  user-select:none!important;
}
.inventoryPinRow *{
  pointer-events:auto!important;
}
.inventoryPinRow.pinned{
  border-color:var(--accent)!important;
}
.inventoryPinDot{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:24px;
  height:24px;
  flex:0 0 24px;
  opacity:.75;
  font-weight:bold;
}
.inventoryPinDot.pinned,
.inventoryPinRow.pinned .inventoryPinDot{
  opacity:1!important;
  color:var(--accent)!important;
}
.inventoryPinnedLocked{
  cursor:default!important;
}
.settingsButton,
.inventoryButton,
.headerActions .settingsButton,
.headerActions .inventoryButton,
.settingsButton:hover,
.inventoryButton:hover,
.headerActions .settingsButton:hover,
.headerActions .inventoryButton:hover,
.settingsButton:focus,
.inventoryButton:focus,
.headerActions .settingsButton:focus,
.headerActions .inventoryButton:focus{
  box-shadow:none!important;
  text-shadow:none!important;
  filter:none!important;
  outline:none!important;
}
.headerShell,
.headerActions{
  background:var(--panel)!important;
}
.fixedTopHeader{
  background:transparent!important;
}


/* Pointerdown inventory pin fix */
.inventoryPinRow{
  cursor:pointer!important;
  pointer-events:auto!important;
  user-select:none!important;
}
.inventoryPinRow *{
  pointer-events:none!important;
}
.inventoryPinRow.pinned{
  border-color:var(--accent)!important;
}


/* Final 10-pin inventory rows */
.inventoryPinRow{
  cursor:pointer!important;
  pointer-events:auto!important;
  user-select:none!important;
}
.inventoryPinRow *{
  pointer-events:none!important;
}
.inventoryPinRow.pinned{
  border-color:var(--accent)!important;
}
.inventoryPinDot.pinned,
.inventoryPinRow.pinned .inventoryPinDot{
  opacity:1!important;
  color:var(--accent)!important;
}


/* Mobile header: show only the first pinned resource pill + Inventory + Settings */
@media (max-width:720px){
  .headerSummary .auctionResourcePill:not(:first-child){
    display:none !important;
  }
  .headerShell{
    grid-template-columns:1fr auto !important;
    min-height:64px !important;
  }
  body{
    padding-top:86px !important;
    scroll-padding-top:86px !important;
  }
}


/* Stable header pill slots: compact visible pills inside wider invisible slots */
.headerSummary{
  gap:4px!important;
}
.headerSummary .auctionResourcePill{
  min-width:180px!important;
  box-sizing:border-box!important;
  font-variant-numeric:tabular-nums!important;
  font-feature-settings:"tnum"!important;
}


/* Compact pinned header on smaller resolutions / zoomed layouts:
   keep only the first 4 pinned resource pills visible so the fixed header stays short. */
@media(max-width:1280px){
  .headerSummary .auctionResourcePill:nth-child(n+5){
    display:none!important;
  }
}






.settingsButton .settingsIcon{
  display:inline-block;
}
.settingsButton .settingsText{
  display:inline-block;
  margin-left:4px;
}

@media(max-width:720px){
  .headerActions .settingsButton,
  body.theme-win98 .headerActions .settingsButton,
  button.settingsButton,
  body.theme-win98 button.settingsButton{
    width:36px!important;
    min-width:36px!important;
    max-width:36px!important;
    height:36px!important;
    min-height:36px!important;
    max-height:36px!important;
    padding:0!important;
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    overflow:hidden!important;
    white-space:nowrap!important;
    font-size:18px!important;
    line-height:1!important;
  }

  .settingsButton .settingsText,
  body.theme-win98 .settingsButton .settingsText{
    display:none!important;
  }

  .settingsButton .settingsIcon,
  body.theme-win98 .settingsButton .settingsIcon{
    display:inline-block!important;
    margin:0!important;
    font-size:18px!important;
    line-height:1!important;
  }
}



/* Mobile Settings button final fix: use only the real icon span, never a pseudo-icon or text. */
@media(max-width:720px){
  .headerActions .settingsButton::before,
  body.theme-win98 .headerActions .settingsButton::before{
    content:none!important;
    display:none!important;
  }
  .headerActions .settingsButton,
  body.theme-win98 .headerActions .settingsButton{
    width:36px!important;
    min-width:36px!important;
    max-width:36px!important;
    height:36px!important;
    min-height:36px!important;
    max-height:36px!important;
    padding:0!important;
    font-size:0!important;
    line-height:1!important;
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    overflow:hidden!important;
  }
  .headerActions .settingsButton .settingsText,
  body.theme-win98 .headerActions .settingsButton .settingsText{
    display:none!important;
  }
  .headerActions .settingsButton .settingsIcon,
  body.theme-win98 .headerActions .settingsButton .settingsIcon{
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    margin:0!important;
    font-size:18px!important;
    line-height:1!important;
  }
}

/* Firefox optimization / compatibility layer
   Conservative overrides only: keeps Chrome/WebKit behavior intact while improving Firefox layout stability,
   scrolling, fixed headers, transforms, and icon/button rendering. */
@-moz-document url-prefix(){
  html,
  body{
    min-height:100%;
    background-color:var(--bg)!important;
  }

  body{
    overflow-x:hidden;
    text-rendering:optimizeLegibility;
  }

  .headerShell,
  .fixedTopHeader,
  .settingsPanel,
  .inventoryPanel{
    backface-visibility:hidden;
    transform-style:flat;
    contain:layout paint;
  }

  .inventoryPanel{
    will-change:transform;
  }

  .barFill{
    will-change:transform;
    transform:scaleX(0.0001);
  }

  .headerSummary .auctionResourcePill,
  .inventoryGrid .auctionResourcePill,
  .auctionResourcePill{
    min-height:1.2em;
    line-height:1.25;
  }

  .headerSummary .auctionResourcePill{
    flex:0 0 180px;
    max-width:180px;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
  }

  .resIcon,
  .resIcon::before,
  .resIcon::after{
    transform-box:fill-box;
  }

  button,
  .tab,
  .creditTab,
  .upgradeTab,
  .mainTab{
    appearance:none;
    -moz-appearance:none;
  }

  .settingsButton,
  .inventoryButton,
  .headerActions .settingsButton,
  .headerActions .inventoryButton{
    line-height:1!important;
  }

  .settingsPanel textarea,
  #saveBox{
    line-height:1.25;
  }

  /* Firefox supports scrollbar-color/width, not WebKit scrollbar pseudo-elements.
     Keep themed scrollbars readable without touching WebKit-specific styling. */
  *{
    scrollbar-width:thin;
    scrollbar-color:var(--scroll-thumb) var(--scroll-track);
  }

  body.theme-win98,
  body.theme-win98 *{
    scrollbar-width:auto!important;
    scrollbar-color:#808080 #c0c0c0!important;
  }

  /* Avoid expensive continuous paint effects in Firefox while keeping the same visual state. */
  .auctionPost.expiringSoon{
    animation-duration:.9s;
  }

  @media(max-width:720px){
    .headerShell{
      width:100%;
      max-width:100vw;
    }

    .headerActions{
      min-width:0;
    }

    .inventoryButton,
    .headerActions .settingsButton{
      flex:0 0 auto;
    }

    body.theme-win98 .headerActions .settingsButton,
    body.theme-win98 .headerActions .inventoryButton{
      min-height:34px!important;
    }
  }
}



/* Auction House bulk actions */
.auctionToolbar{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  margin-top:10px;
}
.auctionToolbar button{
  margin-top:0!important;
}

.mainTab,
.tab,
.creditTab,
.upgradeTab{
  touch-action:manipulation;
}

.coreUpgradeSummary{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-top:10px;
}
.coreUpgradeGrid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(250px,1fr));
  gap:12px;
}
.coreUpgradeCard{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:8px;
  padding:12px;
  box-sizing:border-box;
  display:flex;
  flex-direction:column;
  gap:9px;
  min-height:170px;
}
.coreUpgradeCard.affordable{
  border-color:var(--accent);
}
.coreUpgradeTop{
  display:flex;
  justify-content:space-between;
  gap:10px;
  align-items:flex-start;
}
.coreUpgradeTop h3{
  margin:0 0 6px;
}
.coreUpgradeLevel{
  font-weight:bold;
  color:var(--accent);
  white-space:nowrap;
}
.coreUpgradeEffect{
  font-weight:bold;
}
body.theme-win98 .coreUpgradeCard{
  background:#d4d0c8!important;
  color:#000!important;
  border-top:2px solid #fff!important;
  border-left:2px solid #fff!important;
  border-right:2px solid #404040!important;
  border-bottom:2px solid #404040!important;
  border-radius:0!important;
  box-shadow:none!important;
}
body.theme-win98 .coreUpgradeLevel{
  color:#000080!important;
}


/* Auction House animation performance pass:
   Keep visual feedback, but avoid large animated shadows/filters when many posts
   are expiring or trading at once. */
.auctionPost{
  transition:background-color .12s ease,border-color .12s ease,opacity .18s ease!important;
}
.auctionPost.buy,
.auctionPost.sell{
  box-shadow:none!important;
}
.auctionPost.removing.success{
  animation:auctionSuccessRemoveFast .32s ease forwards!important;
}
.auctionPost.removing.expired{
  animation:auctionExpireRemoveFast .32s ease forwards!important;
}
@keyframes auctionSuccessRemoveFast{
  0%{opacity:1;background:#24442b}
  100%{opacity:0;background:#24442b}
}
@keyframes auctionExpireRemoveFast{
  0%{opacity:1;background:#472525}
  100%{opacity:0;background:#472525}
}
.auctionPost.expiringSoon{
  animation:none!important;
}
.auctionPost.expiringSoon:not(.expiryBlinkOn):not(.removing){
  background:#262626!important;
  border-color:#3a3a3a!important;
}
.auctionPost.expiringSoon.expiryBlinkOn:not(.removing){
  background:#3a2424!important;
  border-color:#ff6b6b!important;
}
body.theme-graphite .auctionPost.expiringSoon:not(.expiryBlinkOn):not(.removing){
  background:#dfe0e3!important;
  border-color:#b8bcc3!important;
}
body.theme-graphite .auctionPost.expiringSoon.expiryBlinkOn:not(.removing){
  background:#f3d6d8!important;
  border-color:#bf5a62!important;
  box-shadow:0 0 0 1px rgba(191,90,98,.28),0 0 12px rgba(191,90,98,.28)!important;
}
body.theme-solar .auctionPost.expiringSoon:not(.expiryBlinkOn):not(.removing){
  background:#dcc48b!important;
  border-color:#b59d65!important;
}
body.theme-solar .auctionPost.expiringSoon.expiryBlinkOn:not(.removing){
  background:#e9b98f!important;
  border-color:#a94e2f!important;
  box-shadow:0 0 0 1px rgba(169,78,47,.30),0 0 12px rgba(169,78,47,.30)!important;
}
body.theme-win98 .auctionPost.expiringSoon:not(.removing){
  border-top:2px solid #fff!important;
  border-left:2px solid #fff!important;
  border-right:2px solid #404040!important;
  border-bottom:2px solid #404040!important;
}
body.theme-win98 .auctionPost.expiringSoon:not(.expiryBlinkOn):not(.removing){
  background:#d4d0c8!important;
}
body.theme-win98 .auctionPost.expiringSoon.expiryBlinkOn:not(.removing){
  background:#d8b8b8!important;
}
@keyframes auctionExpireBlinkFast{
  0%,100%{background:#262626;border-color:#3a3a3a}
  50%{background:#3a2424;border-color:#ff6b6b}
}
.auctionResourcePill{
  transition:background-color .12s ease,color .12s ease,border-color .12s ease!important;
}
.auctionResourcePill.hoverGain,
.auctionResourcePill.hoverSpend{
  box-shadow:none!important;
}
.auctionResourcePill.flashGainStrong{
  animation:auctionPillGainFast .5s ease 1!important;
}
.auctionResourcePill.flashSpendStrong{
  animation:auctionPillSpendFast .5s ease 1!important;
}
@keyframes auctionPillGainFast{
  0%{background:#24442b;color:#fff;border-color:#7ee787}
  100%{background:#171717;color:#cfcfcf;border-color:#333}
}
@keyframes auctionPillSpendFast{
  0%{background:#472525;color:#fff;border-color:#ff6b6b}
  100%{background:#171717;color:#cfcfcf;border-color:#333}
}
