@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&family=Rajdhani:wght@400;600;700&display=swap');

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background: #000000;
  min-height: 100vh;
  color: #e8e8e8;
  font-family: 'Share Tech Mono', 'Courier New', monospace;
}

/* ─── Terminal scanline overlay ─── */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.06) 2px,
    rgba(0, 0, 0, 0.06) 4px
  );
  pointer-events: none;
  z-index: 9999;
}

/* ══════════════════════════════════════════════════
   SKIN: RETRO CRT
   Phosphor green, heavy scanlines, vignette
   ══════════════════════════════════════════════════ */

body.skin-retro-crt {
  background: #000e00;
  color: #00ff41;
}

/* CRT scanlines — heavier than default */
body.skin-retro-crt::before {
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 1px,
    rgba(0, 0, 0, 0.22) 1px,
    rgba(0, 0, 0, 0.22) 3px
  );
}

/* Vignette via ::after */
body.skin-retro-crt::after {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(ellipse at center, transparent 60%, rgba(0,0,0,0.75) 100%);
  pointer-events: none;
  z-index: 9998;
}

body.skin-retro-crt #terminal-statusbar {
  background: #003300;
  color: #00ff41;
  border-bottom-color: #00aa22;
}

body.skin-retro-crt #terminal-statusbar .term-brand { color: #00ff41; }
body.skin-retro-crt #terminal-statusbar .tick-up { color: #00ff41; }
body.skin-retro-crt #terminal-statusbar .tick-dn { color: #88ff00; }

body.skin-retro-crt #game-header {
  background: #000e00;
  color: #00ff41;
  border-bottom-color: #004400;
  text-shadow: 0 0 8px rgba(0,255,65,0.6);
}

body.skin-retro-crt #game-header .header-subtitle { color: #008833; }
body.skin-retro-crt #header-clock { color: #006622; }

body.skin-retro-crt #terminal-navbar { background: #000e00; border-bottom-color: #004400; }
body.skin-retro-crt .term-tab { color: #006622; border-right-color: #003300; }
body.skin-retro-crt .term-tab.active { background: #003300; color: #00ff41; }
body.skin-retro-crt .term-tab.green { color: #00ff41; }

body.skin-retro-crt #main-layout { background: #001a00; }
body.skin-retro-crt #store,
body.skin-retro-crt #inventory,
body.skin-retro-crt #game-container { background: #000e00; border-color: #002200; }
body.skin-retro-crt canvas { background: #000500; }

body.skin-retro-crt .panel-header { background: #001500; border-bottom-color: #003300; }
body.skin-retro-crt .panel-label { color: #00ff41; }

body.skin-retro-crt button {
  background: #000e00;
  color: #00cc33;
  border-bottom-color: #002200;
}
body.skin-retro-crt button:hover { background: #001a00; color: #00ff41; }
body.skin-retro-crt button:active { background: #002a00; color: #00ff55; }

body.skin-retro-crt #clicker-button {
  background: #004400;
  color: #00ff41;
  border-top-color: #002200;
  text-shadow: 0 0 6px rgba(0,255,65,0.5);
}
body.skin-retro-crt #clicker-button:hover { background: #005500; }
body.skin-retro-crt #clicker-button:active { background: #003300; }

body.skin-retro-crt #achievements-bar { background: #000e00; border-top-color: #003300; }
body.skin-retro-crt .achievement { color: #004400; border-color: #003300; }
body.skin-retro-crt .achievement.unlocked { color: #00ff41; border-color: #008833; background: #001500; }

/* ══════════════════════════════════════════════════
   SKIN: BRUTALIST ACCOUNTING
   Stark black/white, zero decoration, raw numbers
   ══════════════════════════════════════════════════ */

body.skin-brutalist {
  background: #ffffff;
  color: #000000;
  font-family: 'Courier New', Courier, monospace;
}

body.skin-brutalist::before { display: none; }

body.skin-brutalist #terminal-statusbar {
  background: #000000;
  color: #ffffff;
  border-bottom: 3px solid #000000;
}
body.skin-brutalist #terminal-statusbar .term-brand { color: #ffffff; }
body.skin-brutalist #terminal-statusbar .tick-up { color: #ffffff; }
body.skin-brutalist #terminal-statusbar .tick-dn { color: #aaaaaa; }

body.skin-brutalist #game-header {
  background: #ffffff;
  color: #000000;
  border-bottom: 3px solid #000000;
}
body.skin-brutalist #game-header .header-subtitle { color: #555555; }
body.skin-brutalist #header-clock { color: #333333; }

body.skin-brutalist #terminal-navbar { background: #eeeeee; border-bottom: 2px solid #000000; }
body.skin-brutalist .term-tab { color: #555555; border-right: 1px solid #cccccc; }
body.skin-brutalist .term-tab.active { background: #000000; color: #ffffff; }
body.skin-brutalist .term-tab.green { color: #000000; font-weight: bold; }

body.skin-brutalist #main-layout { background: #cccccc; }
body.skin-brutalist #store,
body.skin-brutalist #inventory,
body.skin-brutalist #game-container { background: #ffffff; border-color: #cccccc; }
body.skin-brutalist canvas { background: #f5f5f5; }

body.skin-brutalist .panel-header { background: #eeeeee; border-bottom: 2px solid #000000; }
body.skin-brutalist .panel-label { color: #000000; }
body.skin-brutalist .panel-count { color: #555555; }

body.skin-brutalist button {
  background: #ffffff;
  color: #000000;
  border-bottom: 1px solid #cccccc;
}
body.skin-brutalist button:hover { background: #eeeeee; color: #000000; border-color: #aaaaaa; }
body.skin-brutalist button:active { background: #000000; color: #ffffff; }

body.skin-brutalist #clicker-button {
  background: #000000;
  color: #ffffff;
  border: none;
  border-top: 2px solid #000000;
}
body.skin-brutalist #clicker-button:hover { background: #333333; color: #ffffff; }
body.skin-brutalist #clicker-button:active { background: #000000; }

body.skin-brutalist .click-pop { color: #000000; text-shadow: none; }

body.skin-brutalist #achievements-bar { background: #f0f0f0; border-top: 2px solid #000000; }
body.skin-brutalist #achievements-bar .ach-label { color: #000000; }
body.skin-brutalist .achievement { color: #aaaaaa; border: 1px solid #cccccc; }
body.skin-brutalist .achievement.unlocked { color: #000000; border-color: #000000; background: #eeeeee; }

body.skin-brutalist #canvas-header { background: #f0f0f0; border-bottom: 1px solid #cccccc; }
body.skin-brutalist #canvas-header .canvas-label { color: #000000; }

/* ══════════════════════════════════════════════════
   SKIN: SOLAR FORGE
   Molten amber glow, mining/smelting aesthetic
   ══════════════════════════════════════════════════ */

body.skin-solar-forge {
  background: #1a0d00;
  color: #f8a100;
}

body.skin-solar-forge::before {
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(248,161,0,0.03) 2px,
    rgba(248,161,0,0.03) 4px
  );
}

body.skin-solar-forge #terminal-statusbar {
  background: #f8a100;
  color: #1a0d00;
  border-bottom-color: #c47d00;
}
body.skin-solar-forge #terminal-statusbar .term-brand { color: #1a0d00; }
body.skin-solar-forge #terminal-statusbar .tick-up { color: #1a0d00; }
body.skin-solar-forge #terminal-statusbar .tick-dn { color: #5a3800; }

body.skin-solar-forge #game-header {
  background: #1a0d00;
  color: #f8a100;
  border-bottom-color: #3d2200;
  text-shadow: 0 0 10px rgba(248,161,0,0.4);
}
body.skin-solar-forge #game-header .header-subtitle { color: #a06800; }
body.skin-solar-forge #header-clock { color: #8a5a00; }

body.skin-solar-forge #terminal-navbar { background: #1a0d00; border-bottom-color: #3d2200; }
body.skin-solar-forge .term-tab { color: #8a5a00; border-right-color: #2a1500; }
body.skin-solar-forge .term-tab.active { background: #3d2200; color: #f8a100; }
body.skin-solar-forge .term-tab.green { color: #f8a100; }

body.skin-solar-forge #main-layout { background: #241300; }
body.skin-solar-forge #store,
body.skin-solar-forge #inventory,
body.skin-solar-forge #game-container { background: #1a0d00; border-color: #3d2200; }
body.skin-solar-forge canvas { background: #140a00; }

body.skin-solar-forge .panel-header { background: #241300; border-bottom-color: #3d2200; }
body.skin-solar-forge .panel-label { color: #f8a100; }

body.skin-solar-forge button {
  background: #1a0d00;
  color: #c47d00;
  border-bottom-color: #3d2200;
}
body.skin-solar-forge button:hover { background: #241300; color: #f8a100; }
body.skin-solar-forge button:active { background: #3d2200; color: #ffb833; }

body.skin-solar-forge #clicker-button {
  background: #5a3800;
  color: #f8a100;
  border-top-color: #3d2200;
  text-shadow: 0 0 8px rgba(248,161,0,0.5);
}
body.skin-solar-forge #clicker-button:hover { background: #6b4400; }
body.skin-solar-forge #clicker-button:active { background: #3d2200; }

body.skin-solar-forge #achievements-bar { background: #1a0d00; border-top-color: #3d2200; }
body.skin-solar-forge .achievement { color: #5a3800; border-color: #3d2200; }
body.skin-solar-forge .achievement.unlocked { color: #f8a100; border-color: #c47d00; background: #241300; }

/* ══════════════════════════════════════════════════
   SKIN: VOID TRADER
   Deep-space minimalism, silver on black
   ══════════════════════════════════════════════════ */

body.skin-void-trader {
  background: #050510;
  color: #b0b0c0;
}

body.skin-void-trader::before { display: none; }

body.skin-void-trader #terminal-statusbar {
  background: #12121f;
  color: #808090;
  border-bottom-color: #1a1a2e;
}
body.skin-void-trader #terminal-statusbar .term-brand { color: #9090a0; }
body.skin-void-trader #terminal-statusbar .tick-up { color: #b0b0c0; }
body.skin-void-trader #terminal-statusbar .tick-dn { color: #606070; }

body.skin-void-trader #game-header {
  background: #050510;
  color: #b0b0c0;
  border-bottom-color: #1a1a2e;
}
body.skin-void-trader #game-header .header-subtitle { color: #606070; }
body.skin-void-trader #header-clock { color: #505060; }

body.skin-void-trader #terminal-navbar { background: #08081a; border-bottom-color: #1a1a2e; }
body.skin-void-trader .term-tab { color: #505060; border-right-color: #12121f; }
body.skin-void-trader .term-tab.active { background: #1a1a2e; color: #b0b0c0; }
body.skin-void-trader .term-tab.green { color: #b0b0c0; }

body.skin-void-trader #main-layout { background: #0a0a18; }
body.skin-void-trader #store,
body.skin-void-trader #inventory,
body.skin-void-trader #game-container { background: #050510; border-color: #1a1a2e; }
body.skin-void-trader canvas { background: #030308; }

body.skin-void-trader .panel-header { background: #0a0a18; border-bottom-color: #1a1a2e; }
body.skin-void-trader .panel-label { color: #808090; }

body.skin-void-trader button {
  background: #08081a;
  color: #808090;
  border-bottom-color: #1a1a2e;
}
body.skin-void-trader button:hover { background: #12121f; color: #b0b0c0; }
body.skin-void-trader button:active { background: #1a1a2e; color: #d0d0e0; }

body.skin-void-trader #clicker-button {
  background: #1a1a2e;
  color: #b0b0c0;
  border-top-color: #12121f;
}
body.skin-void-trader #clicker-button:hover { background: #222240; }
body.skin-void-trader #clicker-button:active { background: #12121f; }

body.skin-void-trader #achievements-bar { background: #050510; border-top-color: #1a1a2e; }
body.skin-void-trader .achievement { color: #303040; border-color: #1a1a2e; }
body.skin-void-trader .achievement.unlocked { color: #b0b0c0; border-color: #505060; background: #0a0a18; }

/* ══════════════════════════════════════════════════
   SKIN: FREIGHTER BLUE
   Industrial steel, station blue, utilitarian
   ══════════════════════════════════════════════════ */

body.skin-freighter-blue {
  background: #0a1628;
  color: #6ca6d4;
}

body.skin-freighter-blue::before { display: none; }

body.skin-freighter-blue #terminal-statusbar {
  background: #1a3050;
  color: #a0c8e8;
  border-bottom-color: #2a4a70;
}
body.skin-freighter-blue #terminal-statusbar .term-brand { color: #a0c8e8; }
body.skin-freighter-blue #terminal-statusbar .tick-up { color: #a0c8e8; }
body.skin-freighter-blue #terminal-statusbar .tick-dn { color: #4a7090; }

body.skin-freighter-blue #game-header {
  background: #0a1628;
  color: #6ca6d4;
  border-bottom-color: #1a3050;
}
body.skin-freighter-blue #game-header .header-subtitle { color: #3a6888; }
body.skin-freighter-blue #header-clock { color: #2a5878; }

body.skin-freighter-blue #terminal-navbar { background: #0e1e34; border-bottom-color: #1a3050; }
body.skin-freighter-blue .term-tab { color: #3a6888; border-right-color: #142840; }
body.skin-freighter-blue .term-tab.active { background: #1a3050; color: #a0c8e8; }
body.skin-freighter-blue .term-tab.green { color: #6ca6d4; }

body.skin-freighter-blue #main-layout { background: #0e1e34; }
body.skin-freighter-blue #store,
body.skin-freighter-blue #inventory,
body.skin-freighter-blue #game-container { background: #0a1628; border-color: #1a3050; }
body.skin-freighter-blue canvas { background: #081220; }

body.skin-freighter-blue .panel-header { background: #0e1e34; border-bottom-color: #1a3050; }
body.skin-freighter-blue .panel-label { color: #6ca6d4; }

body.skin-freighter-blue button {
  background: #0e1e34;
  color: #4a8ab4;
  border-bottom-color: #1a3050;
}
body.skin-freighter-blue button:hover { background: #142840; color: #6ca6d4; }
body.skin-freighter-blue button:active { background: #1a3050; color: #a0c8e8; }

body.skin-freighter-blue #clicker-button {
  background: #1a3050;
  color: #a0c8e8;
  border-top-color: #142840;
}
body.skin-freighter-blue #clicker-button:hover { background: #2a4a70; }
body.skin-freighter-blue #clicker-button:active { background: #142840; }

body.skin-freighter-blue #achievements-bar { background: #0a1628; border-top-color: #1a3050; }
body.skin-freighter-blue .achievement { color: #1a3050; border-color: #142840; }
body.skin-freighter-blue .achievement.unlocked { color: #6ca6d4; border-color: #4a8ab4; background: #0e1e34; }

/* ══════════════════════════════════════════════════
   SKIN: STATION BLACK MARKET
   Neon underground, hot magenta + electric cyan
   ══════════════════════════════════════════════════ */

body.skin-black-market {
  background: #0a0a0a;
  color: #00ffcc;
}

body.skin-black-market::before {
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 1px,
    rgba(255,0,102,0.04) 1px,
    rgba(255,0,102,0.04) 3px
  );
}

body.skin-black-market #terminal-statusbar {
  background: #1a001a;
  color: #ff0066;
  border-bottom-color: #ff0066;
}
body.skin-black-market #terminal-statusbar .term-brand { color: #ff0066; }
body.skin-black-market #terminal-statusbar .tick-up { color: #00ffcc; }
body.skin-black-market #terminal-statusbar .tick-dn { color: #ff0066; }

body.skin-black-market #game-header {
  background: #0a0a0a;
  color: #00ffcc;
  border-bottom-color: #1a0033;
  text-shadow: 0 0 8px rgba(0,255,204,0.3), 0 0 20px rgba(255,0,102,0.15);
}
body.skin-black-market #game-header .header-subtitle { color: #ff0066; }
body.skin-black-market #header-clock { color: #660033; }

body.skin-black-market #terminal-navbar { background: #0d0d0d; border-bottom-color: #1a0033; }
body.skin-black-market .term-tab { color: #660033; border-right-color: #1a001a; }
body.skin-black-market .term-tab.active { background: #1a0033; color: #ff0066; }
body.skin-black-market .term-tab.green { color: #00ffcc; }

body.skin-black-market #main-layout { background: #0d0d0d; }
body.skin-black-market #store,
body.skin-black-market #inventory,
body.skin-black-market #game-container { background: #0a0a0a; border-color: #1a0033; }
body.skin-black-market canvas { background: #050505; }

body.skin-black-market .panel-header { background: #0d0d0d; border-bottom-color: #1a0033; }
body.skin-black-market .panel-label { color: #ff0066; }

body.skin-black-market button {
  background: #0d0d0d;
  color: #cc0055;
  border-bottom-color: #1a0033;
}
body.skin-black-market button:hover { background: #1a001a; color: #ff0066; }
body.skin-black-market button:active { background: #1a0033; color: #00ffcc; }

body.skin-black-market #clicker-button {
  background: #1a0033;
  color: #00ffcc;
  border-top-color: #ff0066;
  text-shadow: 0 0 8px rgba(0,255,204,0.4);
}
body.skin-black-market #clicker-button:hover { background: #2a0044; }
body.skin-black-market #clicker-button:active { background: #0d001a; }

body.skin-black-market #achievements-bar { background: #0a0a0a; border-top-color: #1a0033; }
body.skin-black-market .achievement { color: #330019; border-color: #1a0033; }
body.skin-black-market .achievement.unlocked { color: #00ffcc; border-color: #ff0066; background: #0d0d0d; }

/* ══════════════════════════════════════════════════
   SKIN: ORE BARON
   Luxury gold on deep burgundy, premium feel
   ══════════════════════════════════════════════════ */

body.skin-ore-baron {
  background: #0a0808;
  color: #d4af37;
}

body.skin-ore-baron::before {
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(212,175,55,0.02) 3px,
    rgba(212,175,55,0.02) 6px
  );
}

body.skin-ore-baron #terminal-statusbar {
  background: #d4af37;
  color: #1a0808;
  border-bottom-color: #a88a2a;
}
body.skin-ore-baron #terminal-statusbar .term-brand { color: #1a0808; }
body.skin-ore-baron #terminal-statusbar .tick-up { color: #1a0808; }
body.skin-ore-baron #terminal-statusbar .tick-dn { color: #4a2020; }

body.skin-ore-baron #game-header {
  background: #0a0808;
  color: #d4af37;
  border-bottom-color: #2a1515;
  text-shadow: 0 0 12px rgba(212,175,55,0.3);
}
body.skin-ore-baron #game-header .header-subtitle { color: #8a7028; }
body.skin-ore-baron #header-clock { color: #6a5520; }

body.skin-ore-baron #terminal-navbar { background: #0e0a0a; border-bottom-color: #2a1515; }
body.skin-ore-baron .term-tab { color: #6a5520; border-right-color: #1a1010; }
body.skin-ore-baron .term-tab.active { background: #2a1515; color: #d4af37; }
body.skin-ore-baron .term-tab.green { color: #d4af37; }

body.skin-ore-baron #main-layout { background: #100c0c; }
body.skin-ore-baron #store,
body.skin-ore-baron #inventory,
body.skin-ore-baron #game-container { background: #0a0808; border-color: #2a1515; }
body.skin-ore-baron canvas { background: #080606; }

body.skin-ore-baron .panel-header { background: #100c0c; border-bottom-color: #2a1515; }
body.skin-ore-baron .panel-label { color: #d4af37; }

body.skin-ore-baron button {
  background: #0e0a0a;
  color: #a88a2a;
  border-bottom-color: #2a1515;
}
body.skin-ore-baron button:hover { background: #1a1010; color: #d4af37; }
body.skin-ore-baron button:active { background: #2a1515; color: #e8c84a; }

body.skin-ore-baron #clicker-button {
  background: #2a1515;
  color: #d4af37;
  border-top-color: #a88a2a;
  text-shadow: 0 0 10px rgba(212,175,55,0.4);
}
body.skin-ore-baron #clicker-button:hover { background: #3a2020; }
body.skin-ore-baron #clicker-button:active { background: #1a1010; }

body.skin-ore-baron #achievements-bar { background: #0a0808; border-top-color: #2a1515; }
body.skin-ore-baron .achievement { color: #2a1515; border-color: #1a1010; }
body.skin-ore-baron .achievement.unlocked { color: #d4af37; border-color: #a88a2a; background: #100c0c; }

/* ══════════════════════════════════════════════════
   PATRON BADGE
   ══════════════════════════════════════════════════ */

#patron-badge {
  font-size: 10px;
  letter-spacing: 0.1em;
  padding: 2px 7px;
  border: 1px solid #f8a100;
  color: #f8a100;
  background: #110900;
  margin-left: 8px;
  vertical-align: middle;
}

body.skin-retro-crt #patron-badge {
  border-color: #00ff41;
  color: #00ff41;
  background: #001500;
}

body.skin-brutalist #patron-badge {
  border: 1px solid #000;
  color: #000;
  background: #f0f0f0;
}

body.skin-solar-forge #patron-badge {
  border-color: #f8a100;
  color: #f8a100;
  background: #241300;
}

body.skin-void-trader #patron-badge {
  border-color: #505060;
  color: #808090;
  background: #0a0a18;
}

body.skin-freighter-blue #patron-badge {
  border-color: #4a8ab4;
  color: #6ca6d4;
  background: #0e1e34;
}

body.skin-black-market #patron-badge {
  border-color: #ff0066;
  color: #ff0066;
  background: #1a001a;
}

body.skin-ore-baron #patron-badge {
  border-color: #d4af37;
  color: #d4af37;
  background: #100c0c;
}

/* ══════════════════════════════════════════════════
   INVESTOR MODE ANALYTICS PANEL
   ══════════════════════════════════════════════════ */

#investor-analytics {
  background: #0a0a0a;
  border-top: 1px solid #1a1a1a;
  padding: 10px 16px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  color: #888;
  display: flex;
  gap: 32px;
  align-items: center;
}

#investor-analytics .inv-label {
  font-size: 9px;
  letter-spacing: 0.15em;
  color: #f8a100;
  text-transform: uppercase;
  margin-right: 4px;
}

#investor-analytics .inv-stat {
  white-space: nowrap;
}

body.skin-retro-crt #investor-analytics {
  background: #000e00;
  border-top-color: #003300;
  color: #006622;
}
body.skin-retro-crt #investor-analytics .inv-label { color: #00ff41; }

body.skin-brutalist #investor-analytics {
  background: #f0f0f0;
  border-top: 2px solid #000;
  color: #333;
}
body.skin-brutalist #investor-analytics .inv-label { color: #000; }

body.skin-solar-forge #investor-analytics {
  background: #1a0d00;
  border-top-color: #3d2200;
  color: #8a5a00;
}
body.skin-solar-forge #investor-analytics .inv-label { color: #f8a100; }

body.skin-void-trader #investor-analytics {
  background: #050510;
  border-top-color: #1a1a2e;
  color: #505060;
}
body.skin-void-trader #investor-analytics .inv-label { color: #808090; }

body.skin-freighter-blue #investor-analytics {
  background: #0a1628;
  border-top-color: #1a3050;
  color: #3a6888;
}
body.skin-freighter-blue #investor-analytics .inv-label { color: #6ca6d4; }

body.skin-black-market #investor-analytics {
  background: #0a0a0a;
  border-top-color: #1a0033;
  color: #660033;
}
body.skin-black-market #investor-analytics .inv-label { color: #ff0066; }

body.skin-ore-baron #investor-analytics {
  background: #0a0808;
  border-top-color: #2a1515;
  color: #6a5520;
}
body.skin-ore-baron #investor-analytics .inv-label { color: #d4af37; }

/* ─── Bloomberg-style top status bar ─── */
#terminal-statusbar {
  background: #f8a100;
  color: #000000;
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  font-weight: bold;
  padding: 3px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  letter-spacing: 0.05em;
  border-bottom: 2px solid #cc8800;
}

#terminal-statusbar .term-brand {
  font-size: 13px;
  font-weight: bold;
  letter-spacing: 0.15em;
}

#terminal-statusbar .term-ticker {
  display: flex;
  gap: 20px;
}

#terminal-statusbar .tick-up { color: #003300; }
#terminal-statusbar .tick-dn { color: #660000; }

/* ─── Header ─── */

#game-header {
  text-align: left;
  padding: 10px 16px 8px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 1.1em;
  font-weight: normal;
  letter-spacing: 0.12em;
  color: #f8a100;
  border-bottom: 1px solid #2a2a2a;
  display: flex;
  align-items: baseline;
  gap: 16px;
  background: #0a0a0a;
}

#game-header .header-subtitle {
  color: #666;
  font-size: 0.75em;
  letter-spacing: 0.08em;
}

#header-clock {
  margin-left: auto;
  color: #888;
  font-size: 0.8em;
}

/* ─── Secondary nav bar ─── */
#terminal-navbar {
  background: #111;
  border-bottom: 1px solid #2a2a2a;
  display: flex;
  padding: 0;
  font-size: 11px;
  font-family: 'Share Tech Mono', monospace;
}

.term-tab {
  padding: 5px 14px;
  color: #666;
  border-right: 1px solid #222;
  cursor: default;
  letter-spacing: 0.08em;
}

.term-tab.active {
  background: #f8a100;
  color: #000;
}

.term-tab.green { color: #00cc44; }
.term-tab.red   { color: #ff4422; }

/* ─── Main layout ─── */

#main-layout {
  display: flex;
  gap: 1px;
  padding: 0;
  align-items: flex-start;
  background: #1a1a1a;
}

/* ─── Center: canvas + click button ─── */

#game-container {
  flex: 1;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  position: relative;
  background: #000;
  border-right: 1px solid #1a1a1a;
}

#canvas-header {
  width: 100%;
  background: #0d0d0d;
  border-bottom: 1px solid #1f1f1f;
  padding: 4px 10px;
  font-size: 10px;
  color: #555;
  letter-spacing: 0.1em;
  text-align: left;
  display: flex;
  justify-content: space-between;
}

#canvas-header .canvas-label { color: #f8a100; }

canvas {
  background: #000;
  border: none;
  border-bottom: 1px solid #1a1a1a;
  max-width: 100%;
  display: block;
}

/* ─── Main click button ─── */

#clicker-button {
  font-family: 'Share Tech Mono', monospace;
  font-size: 1em;
  font-weight: normal;
  letter-spacing: 0.15em;
  padding: 14px 48px;
  background: #f8a100;
  color: #000000;
  border: none;
  border-top: 1px solid #1a1a1a;
  border-radius: 0;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  width: 100%;
  transition: background 0.08s ease;
  text-transform: uppercase;
}

#clicker-button:hover {
  background: #ffb830;
}

#clicker-button:active {
  background: #cc8800;
  transform: none;
}

/* Floating +N click feedback */
.click-pop {
  position: absolute;
  font-family: 'Share Tech Mono', monospace;
  font-size: 1.4em;
  font-weight: bold;
  color: #00ff55;
  pointer-events: none;
  white-space: nowrap;
  text-shadow: 0 0 8px rgba(0, 255, 85, 0.9), 0 0 20px rgba(0, 255, 85, 0.4);
  animation: floatUp 1s ease-out forwards;
  z-index: 100;
}

@keyframes floatUp {
  0%   { opacity: 1; transform: translateY(0) scale(1.2); }
  15%  { opacity: 1; transform: translateY(-8px) scale(1); }
  60%  { opacity: 0.8; transform: translateY(-40px) scale(0.95); }
  100% { opacity: 0; transform: translateY(-70px) scale(0.8); }
}

/* ─── Status bar value pulse ─── */
.nav-pulse {
  animation: navPulse 0.4s ease-out;
}

.yld-pulse {
  animation: yldPulse 0.4s ease-out;
}

@keyframes navPulse {
  0%   { color: #fff; text-shadow: 0 0 8px rgba(255,255,255,0.8); transform: scale(1.15); }
  50%  { color: #f8a100; text-shadow: 0 0 4px rgba(248,161,0,0.5); }
  100% { color: inherit; text-shadow: none; transform: scale(1); }
}

@keyframes yldPulse {
  0%   { color: #00ff55; text-shadow: 0 0 8px rgba(0,255,85,0.8); transform: scale(1.15); }
  50%  { color: #00cc44; text-shadow: 0 0 4px rgba(0,204,68,0.5); }
  100% { color: inherit; text-shadow: none; transform: scale(1); }
}

#status-nav, #status-yield {
  display: inline-block;
  transition: color 0.2s ease;
}

/* ─── Button pulse on click ─── */
@keyframes btnPulse {
  0%   { box-shadow: 0 0 0 0 rgba(248, 161, 0, 0.6); }
  50%  { box-shadow: 0 0 20px 4px rgba(248, 161, 0, 0.3); }
  100% { box-shadow: 0 0 0 0 rgba(248, 161, 0, 0); }
}

#clicker-button.btn-pulse {
  animation: btnPulse 0.3s ease-out;
}

/* ─── Click particles ─── */
.click-particle {
  position: absolute;
  width: 3px;
  height: 3px;
  background: #f8a100;
  pointer-events: none;
  z-index: 99;
  animation: particleBurst 0.6s ease-out forwards;
}

@keyframes particleBurst {
  0%   { opacity: 1; transform: translate(0, 0) scale(1); }
  100% { opacity: 0; transform: translate(var(--px), var(--py)) scale(0); }
}

/* ─── Screen shake ─── */
@keyframes screenShake {
  0%, 100% { transform: translate(0, 0); }
  20%  { transform: translate(-2px, 1px); }
  40%  { transform: translate(2px, -1px); }
  60%  { transform: translate(-1px, 2px); }
  80%  { transform: translate(1px, -2px); }
}

#game-container.shake {
  animation: screenShake 0.15s ease-out;
}

/* ─── Milestone celebration ─── */
.milestone-flash {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 9990;
  animation: milestoneFlash 0.6s ease-out forwards;
}

@keyframes milestoneFlash {
  0%   { background: rgba(248, 161, 0, 0.15); }
  30%  { background: rgba(248, 161, 0, 0.05); }
  100% { background: transparent; }
}

.milestone-banner {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.5);
  font-family: 'Share Tech Mono', monospace;
  font-size: 2em;
  font-weight: bold;
  color: #f8a100;
  text-shadow: 0 0 20px rgba(248, 161, 0, 0.6), 0 0 40px rgba(248, 161, 0, 0.3);
  pointer-events: none;
  z-index: 9991;
  white-space: nowrap;
  letter-spacing: 0.15em;
  animation: milestoneBanner 1.5s ease-out forwards;
}

@keyframes milestoneBanner {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
  15%  { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
  25%  { transform: translate(-50%, -50%) scale(1); }
  70%  { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -60%) scale(0.95); }
}

/* Confetti particles for milestones */
.confetti {
  position: fixed;
  width: 6px;
  height: 6px;
  pointer-events: none;
  z-index: 9992;
  animation: confettiFall var(--fall-duration, 2s) ease-in forwards;
}

@keyframes confettiFall {
  0%   { opacity: 1; transform: translateY(0) rotate(0deg); }
  100% { opacity: 0; transform: translateY(100vh) rotate(var(--spin, 720deg)); }
}

/* ─── PWYC support toast ─── */
#hud-messages {
  position: fixed;
  top: 60px;
  right: 16px;
  z-index: 9990;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.support-toast {
  pointer-events: auto;
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px;
  letter-spacing: 1px;
  color: #f8a100;
  background: rgba(10, 10, 10, 0.95);
  border: 1px solid rgba(248, 161, 0, 0.3);
  border-left: 3px solid #f8a100;
  padding: 12px 16px;
  max-width: 360px;
  box-shadow: 0 0 20px rgba(248, 161, 0, 0.1);
  animation: toastSlideIn 0.4s ease-out forwards;
  cursor: default;
}

.support-toast .toast-label {
  display: block;
  font-size: 9px;
  color: #555;
  letter-spacing: 2px;
  margin-bottom: 4px;
}

.support-toast .toast-body {
  line-height: 1.5;
  color: #ccc;
}

.support-toast .toast-link {
  display: inline-block;
  margin-top: 6px;
  color: #f8a100;
  text-decoration: none;
  cursor: pointer;
  border-bottom: 1px solid rgba(248, 161, 0, 0.3);
  transition: border-color 0.2s;
}

.support-toast .toast-link:hover {
  border-color: #f8a100;
}

.support-toast.toast-dismiss {
  animation: toastSlideOut 0.3s ease-in forwards;
}

@keyframes toastSlideIn {
  0%   { opacity: 0; transform: translateX(80px); }
  100% { opacity: 1; transform: translateX(0); }
}

@keyframes toastSlideOut {
  0%   { opacity: 1; transform: translateX(0); }
  100% { opacity: 0; transform: translateX(80px); }
}

.hud-error {
  pointer-events: auto;
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  color: #ff4444;
  background: rgba(10, 10, 10, 0.95);
  border: 1px solid rgba(255, 68, 68, 0.3);
  padding: 8px 12px;
  max-width: 360px;
  animation: toastSlideIn 0.4s ease-out forwards;
}

/* ─── Lore fragment overlay ─── */
.lore-fragment-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0);
  z-index: 9995;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.4s ease;
  cursor: pointer;
}
.lore-fragment-overlay.active {
  background: rgba(0, 0, 0, 0.85);
}
.lore-fragment-panel {
  max-width: 520px;
  width: 90%;
  border: 1px solid #f8a100;
  background: #0a0a0a;
  padding: 24px;
  font-family: 'Share Tech Mono', monospace;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s ease 0.1s, transform 0.4s ease 0.1s;
  cursor: default;
}
.lore-fragment-overlay.active .lore-fragment-panel {
  opacity: 1;
  transform: translateY(0);
}
.lore-fragment-header {
  color: #f8a100;
  font-size: 0.7em;
  letter-spacing: 0.1em;
  margin-bottom: 16px;
  opacity: 0.7;
}
.lore-fragment-body {
  color: #cccccc;
  font-size: 0.85em;
  line-height: 1.7;
  margin-bottom: 20px;
}
.lore-fragment-dismiss {
  color: #f8a100;
  font-size: 0.7em;
  letter-spacing: 0.15em;
  text-align: center;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.2s;
}
.lore-fragment-dismiss:hover {
  opacity: 1;
}

/* ─── Yield ticking effect ─── */
.yield-tick {
  animation: yieldTick 0.3s ease-out;
}

@keyframes yieldTick {
  0%   { color: #00ff55; }
  100% { color: #00cc44; }
}

/* ─── Panel shared styles ─── */

.panel-header {
  background: #111;
  border-bottom: 1px solid #222;
  padding: 4px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-label {
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px;
  font-weight: normal;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #f8a100;
}

.panel-count {
  font-size: 10px;
  color: #444;
  letter-spacing: 0.05em;
}

/* ─── Store panel ─── */

#store {
  width: 280px;
  margin-top: 0;
  font-size: 13px;
  flex-shrink: 0;
  background: #000;
  border-right: 1px solid #1a1a1a;
}

.item {
  width: 100%;
  margin-bottom: 0;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 0;
  border-bottom: 1px solid #111;
}

/* ─── Inventory panel ─── */

#inventory {
  width: 220px;
  margin-top: 0;
  font-size: 13px;
  flex-shrink: 0;
  background: #000;
}

/* ─── Store/inventory buttons ─── */

button {
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px;
  font-weight: normal;
  padding: 7px 10px;
  border-radius: 0;
  border: none;
  border-bottom: 1px solid #111;
  cursor: pointer;
  width: 100%;
  text-align: left;
  color: #ccc;
  background: #000;
  line-height: 1.4;
  letter-spacing: 0.03em;
  transition: background 0.08s ease, color 0.08s ease;
}

button:hover {
  background: #0f1a0f;
  color: #00cc44;
  border-color: #1a2a1a;
}

button:active {
  background: #001a00;
  color: #00ff55;
}

/* Item research — teal/cyan */
.item-research {
  background: #000;
  color: #00aacc;
}

.item-research:hover {
  background: #000d0f;
  color: #00ccee;
}

/* Upgrade research — amber */
.upgrade-research {
  background: #000;
  color: #f8a100;
}

.upgrade-research:hover {
  background: #0f0a00;
  color: #ffb830;
}

/* hr separators */
hr {
  border: none;
  border-top: 1px solid #1a1a1a;
  margin: 0;
}

/* ─── Achievements bar ─── */
#achievements-bar {
  background: #0a0a0a;
  border-top: 1px solid #1a1a1a;
  padding: 6px 16px;
  font-size: 10px;
  font-family: 'Share Tech Mono', monospace;
  color: #444;
  letter-spacing: 0.08em;
  display: flex;
  gap: 20px;
  align-items: center;
}

#achievements-bar .ach-label {
  color: #f8a100;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-size: 9px;
}

.achievement {
  color: #333;
  padding: 2px 6px;
  border: 1px solid #1a1a1a;
  font-size: 10px;
  opacity: 0.35;
  transition: opacity 0.5s, color 0.5s, border-color 0.5s, background 0.5s;
}

.achievement.unlocked {
  opacity: 1;
  color: #f8a100;
  border-color: #664400;
  background: #110900;
}

/* ─── Score display (legacy) ─── */
#score {
  margin-top: 20px;
  font-size: 24px;
}

/* ─── Blinking cursor ─── */
.blink {
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* ─── Dark Patterns section ─── */

.dark-pattern-header {
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px;
  font-weight: bold;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #ff4422;
  padding: 6px 10px 4px;
  border-bottom: 1px solid #331100;
  background: #0a0000;
}

button.dark-pattern {
  background: #0a0000;
  color: #ff6644;
  border-bottom: 1px solid #220000;
  position: relative;
}

button.dark-pattern:hover {
  background: #1a0500;
  color: #ff8866;
  border-color: #331100;
}

button.dark-pattern:active {
  background: #220800;
  color: #ffaa88;
}

button.dark-pattern small {
  color: #884422;
  font-size: 10px;
}

button.dark-pattern strong {
  color: #ff4422;
}

.dark-pattern-divider {
  border-top: 1px solid #331100;
}

/* Anchoring dark pattern — crossed-out inflated price */
.anchored-price {
  color: #554433;
  font-size: 10px;
  text-decoration: line-through;
  margin-right: 2px;
}

.real-price {
  color: #f8a100;
  font-weight: bold;
}

/* Social proof dark pattern — fake buyer count */
.social-proof-label {
  color: #00cc44;
  font-size: 10px;
  margin-left: 4px;
  animation: social-pulse 2s ease-in-out infinite;
}

@keyframes social-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* Sale indicator for FOMO */
button[data-sale="true"]::before {
  content: "⏱ SALE";
  position: absolute;
  right: 6px;
  top: 4px;
  font-size: 9px;
  color: #ff4422;
  animation: blink 0.5s step-end infinite;
}

/* ─── IPO / Prestige system ─── */

#ipo-panel {
  width: 100%;
  background: #0a0a0a;
  border-top: 1px solid #1a1a1a;
  padding: 8px 12px;
  font-size: 11px;
}

.ipo-status {
  color: #888;
  line-height: 1.6;
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
}

.ipo-status strong {
  color: #f8a100;
}

/* ── Progress bar ── */

.ipo-progress {
  margin-top: 6px;
}

.ipo-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ipo-progress small {
  color: #555;
  font-size: 10px;
}

.ipo-pct {
  color: #f8a100;
  font-weight: bold;
}

.ipo-bar {
  width: 100%;
  height: 6px;
  background: #1a1a1a;
  margin-top: 4px;
  overflow: hidden;
  border-radius: 1px;
}

.ipo-bar-fill {
  height: 100%;
  background: #f8a100;
  transition: width 0.5s ease, background 0.5s ease, box-shadow 0.5s ease;
}

.ipo-bar-warm {
  background: linear-gradient(90deg, #f8a100, #ff6600);
}

.ipo-bar-hot {
  background: linear-gradient(90deg, #ff6600, #ff2200);
  box-shadow: 0 0 6px rgba(255, 34, 0, 0.4);
  animation: ipo-bar-glow 1.5s ease-in-out infinite;
}

.ipo-bar-imminent {
  background: linear-gradient(90deg, #ff2200, #ff0066, #ff2200);
  background-size: 200% 100%;
  box-shadow: 0 0 10px rgba(255, 0, 102, 0.6);
  animation: ipo-bar-pulse 0.8s ease-in-out infinite, ipo-bar-shift 2s linear infinite;
}

@keyframes ipo-bar-glow {
  0%, 100% { box-shadow: 0 0 4px rgba(255, 34, 0, 0.3); }
  50% { box-shadow: 0 0 10px rgba(255, 34, 0, 0.6); }
}

@keyframes ipo-bar-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

@keyframes ipo-bar-shift {
  0% { background-position: 0% 0%; }
  100% { background-position: 200% 0%; }
}

/* ── Pre-IPO preview ── */

.ipo-preview {
  margin-top: 4px;
  color: #555;
  font-size: 10px;
}

.ipo-preview-label {
  color: #666;
}

.ipo-preview-value {
  color: #00ff44;
  font-weight: bold;
}

/* ── IPO Ready: Gains preview ── */

.ipo-gains-preview {
  margin-top: 8px;
  border: 1px solid #1a3300;
  background: linear-gradient(180deg, #0a1a00 0%, #050d00 100%);
  padding: 8px 10px;
}

.ipo-gains-title {
  color: #00ff44;
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 0.15em;
  margin-bottom: 6px;
  text-align: center;
}

.ipo-gains-row {
  display: flex;
  justify-content: space-between;
  padding: 2px 0;
  font-size: 10px;
}

.ipo-gains-label {
  color: #555;
}

.ipo-gains-value {
  color: #ccc;
}

.ipo-gains-highlight {
  color: #00ff44;
  font-weight: bold;
}

.ipo-sentiment {
  margin-top: 6px;
  color: #f8a100;
  font-size: 9px;
  font-style: italic;
  text-align: center;
  opacity: 0.8;
}

/* ── IPO Button (ready state) ── */

.ipo-btn {
  font-family: 'Share Tech Mono', monospace;
  font-size: 13px;
  font-weight: bold;
  letter-spacing: 0.1em;
  padding: 12px 20px;
  background: linear-gradient(180deg, #1a3300 0%, #0a1a00 100%);
  color: #00ff44;
  border: 1px solid #00cc44;
  cursor: pointer;
  width: 100%;
  text-align: center;
  margin-top: 8px;
  transition: background 0.1s ease, box-shadow 0.1s ease;
  border-radius: 0;
}

.ipo-btn-ready {
  animation: ipo-btn-breathe 2s ease-in-out infinite;
}

.ipo-btn:hover {
  background: linear-gradient(180deg, #224400 0%, #0f2200 100%);
  box-shadow: 0 0 16px rgba(0, 204, 68, 0.4);
  color: #00ff66;
}

.ipo-btn:active {
  background: #001a00;
}

.ipo-btn small {
  color: #008833;
  font-size: 10px;
}

@keyframes ipo-btn-breathe {
  0%, 100% { box-shadow: 0 0 4px rgba(0, 204, 68, 0.2); }
  50% { box-shadow: 0 0 16px rgba(0, 204, 68, 0.5); }
}

/* ── IPO Confirmation overlay ── */

.ipo-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: ipo-overlay-in 0.3s ease;
}

@keyframes ipo-overlay-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.ipo-confirm-panel {
  background: #0a0a0a;
  border: 1px solid #f8a100;
  padding: 28px 36px;
  text-align: center;
  font-family: 'Share Tech Mono', monospace;
  max-width: 420px;
  animation: ipo-panel-in 0.3s ease;
}

@keyframes ipo-panel-in {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.ipo-confirm-title {
  color: #f8a100;
  font-size: 16px;
  font-weight: bold;
  letter-spacing: 0.15em;
  margin-bottom: 4px;
}

.ipo-confirm-warning {
  color: #ff4422;
  font-size: 10px;
  letter-spacing: 0.2em;
  margin-bottom: 16px;
}

.ipo-confirm-gains {
  text-align: left;
  margin-bottom: 12px;
}

.ipo-confirm-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 11px;
  color: #ccc;
  border-bottom: 1px solid #111;
}

.ipo-confirm-row span:last-child {
  color: #00ff44;
}

.ipo-confirm-tagline {
  color: #666;
  font-size: 9px;
  font-style: italic;
  margin: 12px 0;
}

.ipo-confirm-buttons {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.ipo-confirm-yes {
  flex: 1;
  background: #f8a100;
  color: #000;
  border: none;
  padding: 10px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 0.1em;
  cursor: pointer;
}

.ipo-confirm-yes:hover {
  background: #ffb830;
}

.ipo-confirm-no {
  flex: 1;
  background: transparent;
  color: #555;
  border: 1px solid #333;
  padding: 10px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px;
  cursor: pointer;
}

.ipo-confirm-no:hover {
  color: #888;
  border-color: #555;
}

/* ── IPO Ceremony (bell + announcement) ── */

.ipo-ceremony-content {
  text-align: center;
  font-family: 'Share Tech Mono', monospace;
  max-width: 480px;
}

.ipo-phase-bell {
  animation: ipo-bell-ring 0.4s ease-in-out 3;
}

.ipo-bell-icon {
  font-size: 72px;
  animation: ipo-bell-swing 0.4s ease-in-out 3;
}

.ipo-bell-text {
  color: #f8a100;
  font-size: 20px;
  letter-spacing: 0.3em;
  margin-top: 16px;
  animation: blink 0.5s step-end 4;
}

@keyframes ipo-bell-swing {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-15deg); }
  75% { transform: rotate(15deg); }
}

.ipo-phase-announce {
  animation: ipo-panel-in 0.5s ease;
}

.ipo-announce-header {
  color: #00ff44;
  font-size: 22px;
  font-weight: bold;
  letter-spacing: 0.2em;
  margin-bottom: 8px;
}

.ipo-announce-market {
  color: #ccc;
  font-size: 13px;
  margin-bottom: 20px;
}

.ipo-announce-market strong {
  color: #f8a100;
}

.ipo-announce-ticker {
  text-align: left;
  border: 1px solid #1a1a1a;
  background: #050505;
  padding: 12px;
  margin-bottom: 16px;
}

.ipo-ticker-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 12px;
  color: #888;
}

.ipo-ticker-label {
  color: #555;
}

.ipo-ticker-value {
  color: #ccc;
}

.ipo-ticker-highlight {
  border-top: 1px solid #1a3300;
  margin-top: 4px;
  padding-top: 8px;
}

.ipo-ticker-highlight .ipo-ticker-value {
  color: #00ff44;
  font-weight: bold;
  font-size: 14px;
}

.ipo-announce-quip {
  color: #666;
  font-size: 10px;
  font-style: italic;
  margin-bottom: 20px;
  line-height: 1.5;
}

.ipo-announce-continue {
  background: #f8a100;
  color: #000;
  border: none;
  padding: 12px 32px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 13px;
  font-weight: bold;
  letter-spacing: 0.1em;
  cursor: pointer;
}

.ipo-announce-continue:hover {
  background: #ffb830;
}

/* ── Post-IPO multiplier demo ── */

.ipo-post-demo {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9998;
  pointer-events: auto;
  cursor: pointer;
  animation: ipo-demo-in 0.4s ease;
}

.ipo-post-demo-inner {
  background: linear-gradient(180deg, #0a1a00, #050d00);
  border: 1px solid #00cc44;
  padding: 12px 24px;
  text-align: center;
  font-family: 'Share Tech Mono', monospace;
  box-shadow: 0 0 20px rgba(0, 204, 68, 0.3);
}

.ipo-post-demo-title {
  color: #00ff44;
  font-size: 10px;
  letter-spacing: 0.2em;
}

.ipo-post-demo-mult {
  color: #00ff44;
  font-size: 28px;
  font-weight: bold;
  text-shadow: 0 0 10px rgba(0, 255, 68, 0.5);
}

.ipo-post-demo-sub {
  color: #555;
  font-size: 9px;
  margin-top: 4px;
}

.ipo-post-demo-fade {
  animation: ipo-demo-out 0.5s ease forwards;
}

@keyframes ipo-demo-in {
  from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes ipo-demo-out {
  from { opacity: 1; transform: translateX(-50%) translateY(0); }
  to { opacity: 0; transform: translateX(-50%) translateY(-20px); }
}

/* ── IPO History log ── */

.ipo-history {
  margin-top: 8px;
  border-top: 1px solid #111;
  padding-top: 6px;
}

.ipo-history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #444;
  font-size: 9px;
  letter-spacing: 0.1em;
  cursor: pointer;
  user-select: none;
}

.ipo-history-header:hover {
  color: #666;
}

.ipo-history-toggle {
  color: #555;
  font-size: 11px;
}

.ipo-history-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.ipo-history.expanded .ipo-history-body {
  max-height: 200px;
  overflow-y: auto;
}

.ipo-history.expanded .ipo-history-toggle {
  transform: rotate(45deg);
  display: inline-block;
}

.ipo-history-row {
  display: flex;
  gap: 8px;
  padding: 3px 0;
  font-size: 9px;
  color: #444;
  border-bottom: 1px solid #0a0a0a;
}

.ipo-history-num {
  color: #f8a100;
  min-width: 20px;
}

.ipo-history-market {
  color: #555;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ipo-history-val {
  color: #666;
}

.ipo-history-mult {
  color: #00ff44;
  min-width: 36px;
  text-align: right;
}

.ipo-history-date {
  color: #333;
  min-width: 45px;
  text-align: right;
}

/* ─── First-run Onboarding Overlay ─── */

#onboarding-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20000;
  animation: onb-fade-in 0.3s ease forwards;
}

#onboarding-overlay.onb-fade-out {
  animation: onb-fade-out 0.3s ease forwards;
}

#onboarding-overlay.onb-step-enter #onboarding-body,
#onboarding-overlay.onb-step-enter #onboarding-title {
  animation: onb-slide-in 0.2s ease forwards;
}

@keyframes onb-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes onb-fade-out {
  from { opacity: 1; }
  to   { opacity: 0; }
}

@keyframes onb-slide-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

#onboarding-box {
  background: #060606;
  border: 1px solid #f8a100;
  max-width: 520px;
  width: 90%;
  padding: 32px 36px 24px;
  font-family: 'Share Tech Mono', 'Courier New', monospace;
  box-shadow: 0 0 40px rgba(248, 161, 0, 0.15);
  position: relative;
}

#onboarding-progress {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
}

.onb-dot {
  width: 8px;
  height: 8px;
  background: #333;
  border: 1px solid #555;
}

.onb-dot.active {
  background: #f8a100;
  border-color: #f8a100;
}

#onboarding-title {
  color: #f8a100;
  font-size: 13px;
  font-weight: bold;
  letter-spacing: 0.12em;
  margin-bottom: 16px;
  border-bottom: 1px solid #1a1a1a;
  padding-bottom: 10px;
}

#onboarding-body {
  color: #ccc;
  font-size: 13px;
  line-height: 1.7;
  min-height: 110px;
}

#onboarding-body ul {
  padding-left: 16px;
  margin: 0;
}

#onboarding-body li {
  margin-bottom: 8px;
}

#onboarding-body strong {
  color: #f8a100;
}

#onboarding-body em {
  color: #aaa;
  font-style: normal;
  text-decoration: underline;
}

#onboarding-body code {
  background: #1a1a1a;
  color: #0f0;
  padding: 1px 5px;
  font-size: 12px;
}

#onboarding-body .onb-meta {
  color: #555;
  font-size: 11px;
  margin-top: 12px;
}

#onboarding-body .onb-highlight {
  border-left: 2px solid #ff4422;
  padding-left: 10px;
  color: #ff8866;
  font-size: 12px;
  margin: 10px 0;
}

#onboarding-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
  border-top: 1px solid #1a1a1a;
  padding-top: 16px;
}

#onboarding-skip {
  background: none;
  border: none;
  color: #444;
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  cursor: pointer;
  padding: 0;
}

#onboarding-skip:hover {
  color: #666;
}

#onboarding-cta {
  background: #f8a100;
  color: #000;
  border: none;
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 0.1em;
  padding: 9px 20px;
  cursor: pointer;
  transition: background 0.1s ease;
}

#onboarding-cta:hover {
  background: #ffb830;
}

#onboarding-cta:active {
  background: #cc8800;
}

/* ─── Welcome-back offline earnings overlay ─── */
#welcome-back-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: wb-fadein 0.3s ease;
}

@keyframes wb-fadein {
  from { opacity: 0; }
  to { opacity: 1; }
}

.wb-panel {
  border: 1px solid #00ff41;
  background: #0a0a0a;
  padding: 2rem 3rem;
  max-width: 420px;
  width: 90%;
  text-align: center;
  box-shadow: 0 0 30px rgba(0, 255, 65, 0.15);
}

.wb-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: #00ff41;
  letter-spacing: 0.15em;
  margin-bottom: 0.2rem;
}

.wb-subtitle {
  font-size: 0.75rem;
  color: #666;
  letter-spacing: 0.2em;
  margin-bottom: 1.5rem;
}

.wb-stat {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid #1a1a1a;
  font-size: 0.85rem;
}

.wb-label {
  color: #888;
}

.wb-value {
  color: #e8e8e8;
}

.wb-total {
  border-bottom: none;
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid #00ff41;
}

.wb-total .wb-value {
  color: #00ff41;
  font-size: 1.1rem;
  font-weight: 700;
}

.wb-dismiss {
  margin-top: 1.5rem;
  background: #00ff41;
  color: #000;
  border: none;
  padding: 0.6rem 2rem;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.9rem;
  cursor: pointer;
  letter-spacing: 0.1em;
  transition: background 0.15s ease;
}

.wb-dismiss:hover {
  background: #33ff66;
}

.wb-dismiss:active {
  background: #00cc33;
}

.wb-streak {
  color: #ffcc00 !important;
  font-weight: 700;
}

.wb-lore {
  margin-top: 1rem;
  padding: 0.75rem;
  border: 1px solid #334;
  background: #0d0d1a;
}

.wb-lore-header {
  font-size: 0.7rem;
  color: #ffcc00;
  letter-spacing: 0.15em;
  margin-bottom: 0.4rem;
  font-weight: 700;
}

.wb-lore-body {
  font-size: 0.75rem;
  color: #aaa;
  line-height: 1.5;
  font-style: italic;
}

/* ═══════════════════════════════════════════
   STREAK BADGE (status bar)
   ═══════════════════════════════════════════ */

.streak-badge {
  color: #ffcc00;
  font-size: 0.8em;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-right: 0.5em;
}

/* ═══════════════════════════════════════════
   LORE TOAST (milestone unlock)
   ═══════════════════════════════════════════ */

.lore-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  border: 1px solid #ffcc00;
  background: #0d0d1a;
  padding: 1rem 1.5rem;
  max-width: 420px;
  width: 90%;
  animation: lore-fadein 0.5s ease;
  box-shadow: 0 0 20px rgba(255, 204, 0, 0.15);
}

.lore-toast-exit {
  opacity: 0;
  transition: opacity 0.5s ease;
}

@keyframes lore-fadein {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.lore-toast-header {
  font-size: 0.7rem;
  color: #ffcc00;
  letter-spacing: 0.15em;
  margin-bottom: 0.4rem;
  font-weight: 700;
}

.lore-toast-body {
  font-size: 0.8rem;
  color: #ccc;
  line-height: 1.5;
  font-style: italic;
}

/* ═══════════════════════════════════════════
   TAB PANELS — SHARED
   ═══════════════════════════════════════════ */

.tab-panel {
  background: #000;
  min-height: 400px;
  padding: 0;
}

.tab-panel-header {
  background: #0a0a0a;
  border-bottom: 1px solid #222;
  padding: 10px 16px;
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.tab-panel-brand {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.12em;
  color: #f8a100;
}

.tab-panel-sub {
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: #555;
}

/* Make tabs clickable */
.term-tab[data-tab] {
  cursor: pointer;
  transition: background 0.1s ease, color 0.1s ease;
}

.term-tab[data-tab]:hover {
  color: #ccc;
}

.term-tab[data-tab].active:hover {
  color: #000;
}

/* ═══════════════════════════════════════════
   ORDER BOOK TAB
   ═══════════════════════════════════════════ */

#orderbook-content {
  padding: 12px 16px;
}

.ob-section {
  margin-bottom: 16px;
}

.ob-section-header {
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: #f8a100;
  padding: 6px 0;
  border-bottom: 1px solid #1a1a1a;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ob-section-icon {
  color: #f8a100;
}

.ob-section-count {
  margin-left: auto;
  color: #444;
  font-size: 9px;
}

.ob-rank-table {
  margin-bottom: 12px;
}

.ob-rank-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px;
  font-size: 11px;
  font-family: 'Share Tech Mono', monospace;
  border-bottom: 1px solid #0a0a0a;
}

.ob-rank-best {
  color: #00ff55;
  font-weight: bold;
  min-width: 40px;
}

.ob-rank-num {
  color: #555;
  min-width: 40px;
}

.ob-rank-name {
  color: #ccc;
  flex: 1;
}

.ob-rank-eff {
  color: #00cc44;
  font-size: 10px;
}

.ob-card {
  background: #0a0a0a;
  border: 1px solid #1a1a1a;
  padding: 8px 10px;
  margin-bottom: 4px;
}

.ob-card-owned {
  border-left: 2px solid #00cc44;
}

.ob-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.ob-card-name {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
  font-size: 13px;
  color: #e8e8e8;
}

.ob-card-price {
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
}

.ob-affordable {
  color: #00cc44;
}

.ob-expensive {
  color: #ff4422;
}

.ob-card-mid {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  font-family: 'Share Tech Mono', monospace;
  color: #666;
  margin-bottom: 2px;
}

.ob-card-yield {
  color: #888;
}

.ob-card-owned {
  color: #888;
}

.ob-card-desc {
  font-size: 10px;
  color: #444;
  margin-bottom: 4px;
  line-height: 1.3;
}

.ob-card-spark {
  height: 24px;
}

.ob-card-spark svg {
  display: block;
}

.ob-no-data {
  font-size: 9px;
  color: #333;
  letter-spacing: 0.1em;
}

/* ═══════════════════════════════════════════
   RESEARCH TAB
   ═══════════════════════════════════════════ */

#research-content {
  padding: 12px 16px;
}

.rt-node {
  margin-bottom: 8px;
  padding: 8px 10px;
  background: #0a0a0a;
  border: 1px solid #1a1a1a;
}

.rt-node.rt-unlocked {
  border-left: 2px solid #00cc44;
}

.rt-node.rt-locked {
  border-left: 2px solid #333;
}

.rt-item-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}

.rt-status {
  font-size: 10px;
  width: 12px;
  text-align: center;
}

.rt-unlocked .rt-status {
  color: #00cc44;
}

.rt-locked .rt-status {
  color: #333;
}

.rt-item-name {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
  font-size: 13px;
  color: #e8e8e8;
  flex: 1;
}

.rt-locked .rt-item-name {
  color: #555;
}

.rt-item-cost {
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px;
  color: #666;
}

.rt-item-desc {
  font-size: 10px;
  color: #444;
  margin-left: 20px;
  margin-bottom: 4px;
  line-height: 1.3;
}

.rt-branch {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 0 3px 10px;
  font-size: 11px;
}

.rt-branch-deep {
  padding-left: 24px;
}

.rt-connector {
  font-family: 'Share Tech Mono', monospace;
  color: #333;
  font-size: 11px;
  white-space: pre;
}

.rt-upgrade-name {
  color: #ccc;
  flex: 1;
}

.rt-locked .rt-upgrade-name {
  color: #444;
}

.rt-upgrade-mult {
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px;
  color: #f8a100;
}

.rt-upgrade-cost {
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px;
  color: #555;
}

.rt-research-name {
  color: #00aacc;
  flex: 1;
}

.rt-locked .rt-research-name {
  color: #004455;
}

.rt-research-pct {
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px;
  color: #00cc44;
}

.rt-research-cost {
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px;
  color: #555;
}

/* ═══════════════════════════════════════════
   MARKET TAB
   ═══════════════════════════════════════════ */

#market-content {
  padding: 12px 16px;
}

.mk-ticker-section {
  margin-bottom: 16px;
  background: #0a0a0a;
  border: 1px solid #1a1a1a;
  padding: 10px;
}

.mk-ticker-label {
  font-family: 'Share Tech Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.15em;
  color: #f8a100;
  margin-bottom: 8px;
}

.mk-ticker-item {
  font-size: 11px;
  color: #555;
  padding: 3px 0;
  font-family: 'Share Tech Mono', monospace;
  line-height: 1.4;
}

.mk-ticker-active {
  color: #ccc;
}

.mk-ticker-dot {
  font-size: 6px;
  vertical-align: middle;
  margin-right: 6px;
}

.mk-ticker-active .mk-ticker-dot {
  color: #00cc44;
}

.mk-status-section, .mk-proj-section, .mk-hist-section {
  margin-bottom: 16px;
  background: #0a0a0a;
  border: 1px solid #1a1a1a;
  padding: 10px;
}

.mk-status-header, .mk-proj-header, .mk-hist-header {
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: #f8a100;
  padding-bottom: 8px;
  border-bottom: 1px solid #1a1a1a;
  margin-bottom: 8px;
}

.mk-stat-grid, .mk-proj-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.mk-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mk-stat-label {
  font-family: 'Share Tech Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.1em;
  color: #555;
}

.mk-stat-value {
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px;
  color: #ccc;
}

.mk-stat-green {
  color: #00cc44;
}

.mk-progress-bar {
  margin-top: 10px;
  height: 6px;
  background: #111;
  border: 1px solid #222;
}

.mk-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #f8a100, #00cc44);
  transition: width 0.3s ease;
}

.mk-ipo-ready {
  text-align: center;
  margin-top: 10px;
  padding: 8px;
  background: #001a00;
  border: 1px solid #00cc44;
  color: #00ff55;
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  animation: blink 1.5s step-end infinite;
}

.mk-hist-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mk-hist-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  border-bottom: 1px solid #0a0a0a;
}

.mk-hist-num {
  color: #555;
  min-width: 30px;
}

.mk-hist-name {
  color: #ccc;
  flex: 1;
}

.mk-hist-mult {
  color: #00cc44;
}

/* ═══════════════════════════════════════════
   RESPONSIVE — MOBILE
   ═══════════════════════════════════════════ */

/* Safe area insets for notched devices */
:root {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

body {
  padding-top: var(--safe-top);
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
  padding-bottom: var(--safe-bottom);
}

/* Touch optimization */
#clicker-button {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.term-tab,
button,
.ipo-btn,
.wb-dismiss,
#onboarding-cta,
#onboarding-skip {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* ─── Mute button (mobile sound policy) ─── */
#mobile-mute-btn {
  position: fixed;
  bottom: calc(12px + var(--safe-bottom));
  right: calc(12px + var(--safe-right));
  z-index: 9997;
  background: #1a1a1a;
  color: #f8a100;
  border: 1px solid #333;
  font-family: 'Share Tech Mono', monospace;
  font-size: 16px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

#mobile-mute-btn:hover {
  background: #222;
  border-color: #f8a100;
}

#mobile-mute-btn.muted {
  color: #555;
  border-color: #222;
}

/* ─── Tablet breakpoint (≤ 768px) ─── */
@media (max-width: 768px) {
  #main-layout {
    flex-direction: column;
  }

  #store,
  #inventory {
    width: 100%;
    flex-shrink: 1;
  }

  #store {
    order: 2;
    border-right: none;
    border-bottom: 1px solid #1a1a1a;
  }

  #game-container {
    order: 1;
    border-right: none;
  }

  #inventory {
    order: 3;
  }

  #game-header {
    flex-wrap: wrap;
    gap: 4px 16px;
    padding: 8px 12px 6px;
    font-size: 1em;
  }

  #game-header .header-subtitle {
    display: none;
  }

  #terminal-statusbar .term-ticker {
    gap: 10px;
    font-size: 10px;
  }

  #terminal-statusbar .term-brand {
    font-size: 11px;
  }

  #terminal-navbar {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  #terminal-navbar::-webkit-scrollbar {
    display: none;
  }

  .term-tab {
    white-space: nowrap;
    flex-shrink: 0;
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: 5px 12px;
  }

  #achievements-bar {
    flex-wrap: wrap;
    gap: 8px;
    padding: 6px 12px;
  }

  .milestone-banner {
    white-space: normal;
    max-width: 90vw;
    text-align: center;
    font-size: 1.4em;
    padding: 0 16px;
  }

  #hud-messages {
    right: 8px;
    left: 8px;
  }

  .support-toast {
    max-width: 100%;
  }

  .lore-fragment-panel {
    padding: 18px;
    max-width: 92vw;
  }
  .lore-fragment-body {
    font-size: 0.8em;
  }

  .ipo-confirm-panel {
    padding: 20px 24px;
    max-width: 90vw;
  }

  .ipo-ceremony-content {
    max-width: 90vw;
  }

  #investor-analytics {
    flex-wrap: wrap;
    gap: 8px 20px;
  }
}

/* ─── Mobile breakpoint (≤ 480px) ─── */
@media (max-width: 480px) {
  #terminal-statusbar {
    padding: 3px 8px;
    font-size: 10px;
  }

  #terminal-statusbar .term-brand {
    font-size: 10px;
    letter-spacing: 0.08em;
  }

  #terminal-statusbar .term-ticker {
    gap: 6px;
    font-size: 9px;
  }

  #terminal-statusbar .term-ticker > span:nth-child(3) {
    display: none;
  }

  #game-header {
    padding: 6px 10px;
    font-size: 0.9em;
  }

  #header-clock {
    display: none;
  }

  .term-tab {
    font-size: 10px;
    padding: 5px 10px;
  }

  #clicker-button {
    padding: 18px 20px;
    font-size: 1.1em;
    min-height: 56px;
  }

  button {
    min-height: 44px;
    padding: 10px;
  }

  .item button,
  .ob-card button {
    min-height: 44px;
  }

  #achievements-bar {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  #achievements-bar::-webkit-scrollbar {
    display: none;
  }

  .achievement {
    white-space: nowrap;
    flex-shrink: 0;
  }

  .ob-rank-row {
    font-size: 10px;
    gap: 6px;
    padding: 6px 4px;
  }

  .ob-card {
    padding: 10px;
  }

  .rt-node {
    padding: 10px;
  }

  .rt-branch {
    padding-left: 6px;
  }

  .rt-branch-deep {
    padding-left: 16px;
  }

  .mk-stat-grid,
  .mk-proj-grid {
    grid-template-columns: 1fr;
  }

  .tab-panel-header {
    padding: 8px 12px;
    flex-wrap: wrap;
    gap: 4px 12px;
  }

  #orderbook-content,
  #research-content,
  #market-content {
    padding: 8px 10px;
  }

  .wb-panel {
    padding: 1.5rem 1.5rem;
  }

  .wb-title {
    font-size: 1.4rem;
  }

  #onboarding-box {
    padding: 24px 20px 20px;
  }

  #onboarding-body {
    font-size: 12px;
    min-height: 80px;
  }

  .ipo-confirm-panel {
    padding: 16px 20px;
  }

  .ipo-bell-icon {
    font-size: 48px;
  }

  .ipo-announce-header {
    font-size: 18px;
  }
}

/* ═══════════════════════════════════════════
   REAL-TIME CHARTS
   ═══════════════════════════════════════════ */

#charts-panel {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  width: 100%;
}

.chart-container {
  flex: 1;
  height: 140px;
  background: #0a0a0a;
  border: 1px solid #1a1a1a;
  border-radius: 2px;
  position: relative;
  overflow: hidden;
}

.chart-container canvas {
  display: block;
  width: 100%;
  height: 100%;
}

@media (max-width: 768px) {
  #charts-panel {
    flex-direction: column;
    gap: 4px;
  }

  .chart-container {
    height: 100px;
  }
}

/* ═══ AUDIT TAB ═══ */
#tab-audit {
  color: #cc4444;
}
#tab-audit.active {
  color: #ff4422;
  border-bottom-color: #ff4422;
}

.audit-header {
  color: #cc4444;
  font-size: 14px;
  padding: 20px 30px 10px;
  letter-spacing: 1px;
}
.audit-header-sub {
  color: #665544;
  font-size: 11px;
}

.audit-section {
  margin: 16px 30px;
  border: 1px solid #332211;
  padding: 12px;
}
.audit-section-title {
  color: #cc4444;
  font-size: 11px;
  letter-spacing: 2px;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid #221100;
}

.audit-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.audit-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 4px 0;
}
.audit-label {
  color: #887755;
  font-size: 12px;
  min-width: 260px;
}
.audit-val {
  color: #f8a100;
  font-size: 14px;
  font-weight: bold;
  min-width: 80px;
}
.audit-note {
  color: #554433;
  font-size: 11px;
  font-style: italic;
}
.audit-val-red { color: #cc4444; }
.audit-val-amber { color: #cc8800; }
.audit-val-dim { color: #554433; }

.audit-footer {
  margin: 24px 30px;
  padding: 12px;
  border-top: 1px solid #332211;
}
.audit-conscience {
  color: #00cc44;
  font-style: italic;
}
.audit-no-conscience {
  color: #554433;
  font-style: italic;
}

.audit-disclaimer {
  margin: 8px 30px 20px;
  color: #332211;
  font-size: 10px;
  letter-spacing: 1px;
}

.faction-threshold {
  font-size: 0.7em;
  padding: 1px 4px;
  margin-left: 6px;
  border-radius: 2px;
}
.faction-hostile {
  color: #cc4444;
  border: 1px solid #552222;
}
.faction-allied {
  color: #44cc44;
  border: 1px solid #225522;
}

/* ══════════════════════════════════════════════════
   CLICK EFFECT PARTICLES
   ══════════════════════════════════════════════════ */

.click-particle {
  position: fixed;
  pointer-events: none;
  z-index: 9990;
}

.click-particle-asteroid {
  background: #b08040;
  border-radius: 1px;
  transform: translate(-50%, -50%);
  animation: asteroid-shatter 0.45s ease-out forwards;
}

@keyframes asteroid-shatter {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) rotate(var(--rot));
  }
}

.click-particle-data {
  font-family: 'Share Tech Mono', 'Courier New', monospace;
  font-size: 11px;
  color: #00ff41;
  text-shadow: 0 0 4px #00ff41;
  transform: translateX(-50%);
  animation: data-cascade 0.5s ease-out forwards;
}

@keyframes data-cascade {
  0% {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(var(--fall));
  }
}

/* ─── Share modal ─── */
.share-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.share-modal-overlay.active {
  opacity: 1;
}

.share-modal {
  background: #0a0a0a;
  border: 1px solid rgba(248, 161, 0, 0.4);
  max-width: 480px;
  width: 90%;
  font-family: 'Share Tech Mono', monospace;
}

.share-modal-header {
  background: #f8a100;
  color: #000;
  font-size: 11px;
  font-weight: bold;
  padding: 6px 14px;
  letter-spacing: 0.1em;
}

.share-modal-preview {
  padding: 16px;
  font-size: 12px;
  line-height: 1.6;
  color: #ccc;
  white-space: pre-wrap;
  word-break: break-word;
  border-bottom: 1px solid #222;
  margin: 0;
  font-family: 'Share Tech Mono', monospace;
}

.share-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 14px;
}

.share-btn {
  background: transparent;
  border: 1px solid #f8a100;
  color: #f8a100;
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  padding: 6px 14px;
  cursor: pointer;
  letter-spacing: 0.08em;
  transition: background 0.2s, color 0.2s;
}

.share-btn:hover {
  background: #f8a100;
  color: #000;
}

.share-btn-close {
  border-color: #444;
  color: #666;
  margin-left: auto;
}

.share-btn-close:hover {
  background: #333;
  color: #ccc;
  border-color: #666;
}

/* Share toast variant */
.share-toast {
  border-left-color: #00cc44;
}
.share-toast .toast-label {
  color: #00cc44;
}

/* Clickable unlocked achievements */
#achievements-bar .achievement.unlocked {
  cursor: pointer;
}
#achievements-bar .achievement.unlocked:hover {
  text-shadow: 0 0 6px rgba(248, 161, 0, 0.6);
}

/* Skin overrides for share modal */
body.skin-retro-crt .share-modal {
  border-color: #004400;
}
body.skin-retro-crt .share-modal-header {
  background: #003300;
  color: #00ff41;
}
body.skin-retro-crt .share-btn {
  border-color: #00ff41;
  color: #00ff41;
}
body.skin-retro-crt .share-btn:hover {
  background: #00ff41;
  color: #000;
}

body.skin-brutalist .share-modal {
  border: 2px solid #000;
}
body.skin-brutalist .share-modal-header {
  background: #000;
  color: #fff;
}
body.skin-brutalist .share-btn {
  border-color: #000;
  color: #000;
}
body.skin-brutalist .share-btn:hover {
  background: #000;
  color: #fff;
}

body.skin-solar-forge .share-modal {
  border-color: #3d2200;
}
body.skin-solar-forge .share-modal-header {
  background: #3d2200;
  color: #f8a100;
}
body.skin-solar-forge .share-btn {
  border-color: #f8a100;
  color: #f8a100;
}
body.skin-solar-forge .share-btn:hover {
  background: #f8a100;
  color: #1a0d00;
}

body.skin-void-trader .share-modal {
  border-color: #1a1a2e;
}
body.skin-void-trader .share-modal-header {
  background: #1a1a2e;
  color: #b0b0c0;
}
body.skin-void-trader .share-btn {
  border-color: #505060;
  color: #808090;
}
body.skin-void-trader .share-btn:hover {
  background: #505060;
  color: #050510;
}

body.skin-freighter-blue .share-modal {
  border-color: #1a3050;
}
body.skin-freighter-blue .share-modal-header {
  background: #1a3050;
  color: #a0c8e8;
}
body.skin-freighter-blue .share-btn {
  border-color: #4a8ab4;
  color: #6ca6d4;
}
body.skin-freighter-blue .share-btn:hover {
  background: #4a8ab4;
  color: #0a1628;
}

body.skin-black-market .share-modal {
  border-color: #ff0066;
}
body.skin-black-market .share-modal-header {
  background: #1a0033;
  color: #ff0066;
}
body.skin-black-market .share-btn {
  border-color: #ff0066;
  color: #00ffcc;
}
body.skin-black-market .share-btn:hover {
  background: #ff0066;
  color: #0a0a0a;
}

body.skin-ore-baron .share-modal {
  border-color: #2a1515;
}
body.skin-ore-baron .share-modal-header {
  background: #2a1515;
  color: #d4af37;
}
body.skin-ore-baron .share-btn {
  border-color: #d4af37;
  color: #d4af37;
}
body.skin-ore-baron .share-btn:hover {
  background: #d4af37;
  color: #0a0808;
}

.featured-merchant-banner {
  border: 1px solid #f8a100;
  background: rgba(248, 161, 0, 0.05);
  padding: 20px 24px;
  margin-bottom: 24px;
  text-align: center;
}
.featured-merchant-label {
  font-size: 10px;
  color: #f8a100;
  letter-spacing: 3px;
  margin-bottom: 6px;
}
.featured-merchant-name {
  font-size: 16px;
  color: #f8a100;
  letter-spacing: 2px;
  margin-bottom: 8px;
}
.featured-merchant-divider {
  height: 1px;
  background: linear-gradient(to right, transparent, #f8a100, transparent);
  margin-bottom: 12px;
}
.featured-merchant-skin {
  font-size: 14px;
  color: #00ff41;
  letter-spacing: 2px;
  margin-bottom: 4px;
}
.featured-merchant-desc {
  font-size: 11px;
  color: #555;
  margin-bottom: 8px;
}
.featured-merchant-lore {
  font-size: 12px;
  color: #888;
  font-style: italic;
  margin-bottom: 12px;
  line-height: 1.6;
}
.featured-merchant-price {
  font-size: 11px;
  color: #888;
  letter-spacing: 1px;
  margin-bottom: 12px;
}
.featured-merchant-buy,
.featured-merchant-apply {
  background: #0d1a0d;
  border: 1px solid #f8a100;
  color: #f8a100;
  font-family: monospace;
  font-size: 12px;
  letter-spacing: 2px;
  padding: 10px 24px;
  cursor: pointer;
}
