/* Finance Clicker — Terminal Market Theme (no Tailwind) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800&family=JetBrains+Mono:wght@400;600;700&display=swap');

:root{
  --bg0:#05070d;
  --bg1:#060a13;
  --panel: rgba(8, 12, 22, 0.68);
  --panel2: rgba(8, 12, 22, 0.52);
  --stroke: rgba(40, 255, 170, 0.18);
  --stroke2: rgba(120, 140, 170, 0.18);
  --text:#e8fff5;
  --muted: rgba(232,255,245,0.65);
  --green:#22c55e;
  --red:#ef4444;
  --accent:#37f2a1;
  --shadow: 0 28px 90px rgba(0,0,0,.65);
  --radius: 18px;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  --sans: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }

html{
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar{
  display: none;
}

body{
  margin:0;
  scrollbar-width: none;
  -ms-overflow-style: none;
  font-family: var(--sans);
  color:var(--text);
  background: linear-gradient(180deg, var(--bg0), var(--bg1)); /* simpler */
  overflow-x:hidden;
}

body.booting > *:not(.screen-loader){
  visibility: hidden;
}

body.booting .screen-loader.visible{
  opacity: 1;
  pointer-events: all;
}

body.landing-active::after{
  content:"";
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.68);
  pointer-events:none;
  z-index: 0;
}

body.landing-active{
  overflow-y: hidden;
}

a{ color: var(--accent); text-decoration:none; }
a:hover{ text-decoration:underline; }

canvas#bg{
  position: fixed;
  inset: 0;
  z-index: -2;
}

.scanlines{
  position: fixed;
  inset:0;
  pointer-events:none;
  z-index:-1;
  background-image: linear-gradient(to bottom, rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 100% 3px;
  opacity: 0.045; /* was 0.06 */
  mix-blend-mode: overlay;
}
.vignette{
  position: fixed;
  inset:0;
  pointer-events:none;
  z-index:-1;
  background: radial-gradient(1100px 800px at 50% 40%, rgba(0,0,0,0.15), rgba(0,0,0,.70));
}

.topbar{
  position: sticky;
  top:0;
  z-index: 20;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  background: rgba(0,0,0,.55);
  border-bottom: 1px solid rgba(40,255,170,0.12);
}

.topbar-inner{
  max-width: 1120px;
  margin:0 auto;
  padding: 14px 16px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.brand{
  display:flex;
  align-items:center;
  gap:12px;
}
.logo{
  width:40px; height:40px;
  border-radius: 14px;
  border: 1px solid rgba(40,255,170,0.18);
  background: rgba(0,0,0,.35);
  display:grid;
  place-items:center;
  font-family: var(--mono);
  font-weight:800;
  color: rgba(55,242,161,0.95);
  box-shadow: 0 0 0 1px rgba(55,242,161,0.06);
}
.brand h1{
  margin:0;
  font-size: 14px;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.brand p{
  margin:2px 0 0;
  font-size: 12px;
  color: var(--muted);
  font-family: var(--mono);
}

.pill{
  display:flex;
  align-items:center;
  gap:8px;
  font-family: var(--mono);
  font-size: 12px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(40,255,170,0.14);
  background: rgba(0,0,0,.35);
  color: rgba(232,255,245,0.75);
}
.dot{
  width: 9px; height: 9px;
  border-radius: 999px;
  background: rgba(55,242,161,0.30);
  box-shadow: 0 0 0 3px rgba(55,242,161,0.08);
}

.actions{ display:flex; align-items:center; gap:10px; }

.btn{
  --btn-scale: 1;
  --btn-tilt-x: 0deg;
  --btn-tilt-y: 0deg;
  appearance:none;
  border: 1px solid rgba(40,255,170,0.18);
  background: rgba(55,242,161,0.10);
  color: rgba(232,255,245,0.92);
  font-family: var(--mono);
  font-size: 13px;
  padding: 10px 12px;
  border-radius: 14px;
  cursor:pointer;
  transform: perspective(780px) rotateX(var(--btn-tilt-x)) rotateY(var(--btn-tilt-y)) scale(var(--btn-scale));
  transition: transform .14s ease, box-shadow .18s ease, background .15s ease, border-color .15s ease;
}
.btn:hover{
  --btn-scale: 1.045;
  background: rgba(55,242,161,0.16);
  border-color: rgba(55,242,161,0.32);
  box-shadow: 0 14px 40px rgba(0,0,0,.55), 0 0 26px rgba(55,242,161,0.10);
}
.btn:active,
.btn.btn-pressed{ --btn-scale: 0.94; }
.btn:disabled{ opacity:.45; cursor:not-allowed; transform:none; box-shadow:none; }
.btn.btn-bounce{ animation: btnBounce .28s cubic-bezier(.2,.86,.3,1.35); }
@keyframes btnBounce{
  0% { transform: perspective(780px) rotateX(var(--btn-tilt-x)) rotateY(var(--btn-tilt-y)) scale(0.94); }
  55% { transform: perspective(780px) rotateX(var(--btn-tilt-x)) rotateY(var(--btn-tilt-y)) scale(1.08); }
  100% { transform: perspective(780px) rotateX(var(--btn-tilt-x)) rotateY(var(--btn-tilt-y)) scale(1.02); }
}
.btn.secondary{
  background: rgba(0,0,0,.32);
  border-color: rgba(120,140,170,0.18);
}
.btn.danger{
  border-color: rgba(239,68,68,0.22);
  background: rgba(239,68,68,0.10);
}
.btn.danger:hover{
  background: rgba(239,68,68,0.16);
  border-color: rgba(239,68,68,0.32);
  box-shadow: 0 14px 40px rgba(0,0,0,.55), 0 0 26px rgba(239,68,68,0.10);
}

.container{
  max-width:1120px;
  margin:0 auto;
  padding: 24px 16px 80px;
  position: relative;
  z-index: 1;
}


.leaderboard-panel{
  margin-bottom: 0;
}

.gameplay-main-grid{
  display:grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap:16px;
  align-items:start;
}

.gameplay-trade-btn{
  width:92%;
  margin:14px auto 0;
  display:block;
  min-height:60px;
  font-size:18px;
  font-weight:800;
  letter-spacing:0.03em;
  text-transform:uppercase;
  border-width:2px;
  border-color: rgba(55,242,161,0.44);
  box-shadow: 0 16px 34px rgba(0,0,0,.5), 0 0 30px rgba(55,242,161,0.24);
  transition: transform .22s cubic-bezier(.2,.8,.2,1), box-shadow .2s ease, background .15s ease, border-color .15s ease;
}

.gameplay-trade-btn:hover{
  --btn-scale: 1.08;
  box-shadow: 0 18px 40px rgba(0,0,0,.52), 0 0 36px rgba(55,242,161,0.34);
}

.upgrades-panel-body{
  max-height: 540px;
  overflow-y: auto;
  padding-right: 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(190, 230, 255, 0.45) rgba(255,255,255,0.05);
}

.upgrades-panel-body::-webkit-scrollbar{
  width: 9px;
}

.upgrades-panel-body::-webkit-scrollbar-track{
  background: rgba(255,255,255,0.04);
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
  backdrop-filter: blur(6px);
}

.upgrades-panel-body::-webkit-scrollbar-thumb{
  background: linear-gradient(180deg, rgba(214, 244, 255, 0.5), rgba(150, 210, 255, 0.28));
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.24);
}

.upgrades-panel-body:hover::-webkit-scrollbar-thumb{
  background: linear-gradient(180deg, rgba(234, 250, 255, 0.72), rgba(169, 221, 255, 0.4));
}

.upgrades-panel-body::-webkit-scrollbar-thumb:active{
  background: linear-gradient(180deg, rgba(245, 253, 255, 0.86), rgba(197, 235, 255, 0.52));
}

.leaderboard-more-btn{
  margin-top: 6px;
}

@media (max-width: 1100px){
  .gameplay-main-grid{
    grid-template-columns: 1fr;
  }

  .upgrades-panel-body{
    max-height: none;
    overflow-y: visible;
    padding-right: 0;
  }

  .gameplay-trade-btn{
    width:100%;
  }
}
.grid{
  display:grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 16px;
}

.landing-grid{
  display:block;
}
.landing-hero{
  max-width: 860px;
  margin: clamp(8px, 2.6vh, 24px) auto 0;
  text-align: center;
  padding: clamp(12px, 2.4vh, 28px) 20px 14px;
}
.landing-prompt{
  margin-bottom: 10px;
  font-size: 17px;
}
.landing-copy{
  margin: clamp(10px, 1.8vh, 16px) auto 0;
  max-width: 30ch;
  font-size: clamp(30px, 5.2vw, 40px);
  font-weight: 700;
  color: rgba(232,255,245,0.92);
}
.landing-actions{
  margin-top: clamp(16px, 2.4vh, 24px);
  display:flex;
  flex-direction: column;
  align-items:center;
  gap: 10px;
}
.landing-login-btn{
  min-width: min(94vw, 520px);
  min-height: clamp(84px, 13vh, 112px);
  font-size: clamp(30px, 4.8vw, 40px);
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border-width: 2px;
  background: rgba(55,242,161,0.16);
  border-color: rgba(55,242,161,0.40);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 22px 40px rgba(0,0,0,0.55), 0 0 26px rgba(55,242,161,0.10), inset 0 0 0 1px rgba(255,255,255,0.12);
}
.landing-learn-btn{
  min-width: min(78vw, 380px);
  min-height: clamp(66px, 9vh, 82px);
  font-size: clamp(20px, 2.8vw, 24px);
  text-transform: uppercase;
  background: rgba(14, 18, 30, 0.62);
  border-color: rgba(165, 255, 221, 0.35);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 18px 34px rgba(0,0,0,0.5), inset 0 0 0 1px rgba(255,255,255,0.10);
}

@media (max-width: 980px){
  .grid{ grid-template-columns: 1fr; }

  body.landing-active{
    overflow-y: auto;
  }

  .container{
    padding-bottom: 28px;
  }

  .landing-hero{
    margin-top: 8px;
    padding-top: 10px;
  }

  .landing-hero .big-title{
    font-size: clamp(40px, 12vw, 60px);
    white-space: normal;
  }

  .landing-copy{
    font-size: clamp(24px, 6.6vw, 34px);
  }

  .landing-login-btn{
    min-height: clamp(72px, 11.5vh, 94px);
    font-size: clamp(22px, 6.4vw, 32px);
  }

  .landing-learn-btn{
    min-width: min(92vw, 420px);
    min-height: 62px;
    font-size: clamp(18px, 4.4vw, 22px);
  }
}

.panel{
  background: var(--panel);
  border: 1px solid rgba(40,255,170,0.14);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow:hidden;
}
.panel-header{
  padding: 16px 18px;
  border-bottom: 1px solid rgba(40,255,170,0.10);
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}
.panel-title{
  margin:0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: .02em;
}
.panel-sub{
  margin:6px 0 0;
  font-size: 12.5px;
  color: var(--muted);
  font-family: var(--mono);
}

.panel-body{ padding: 18px; }
.hr{ height:1px; background: rgba(40,255,170,0.10); margin: 14px 0; }

.big-title{
  font-size: 40px;
  line-height: 1.06;
  margin: 0;
  font-weight: 900;
  letter-spacing: -0.02em;
}
@media (max-width:520px){ .big-title{ font-size: 32px; } }
.landing-hero .big-title{ font-size: clamp(62px, 10vw, 104px); letter-spacing: -0.01em; }
.terminal-title{
  display:flex;
  justify-content:center;
  align-items:center;
  text-align:center;
  white-space: nowrap;
  width: 100%;
  margin: 0 auto;
}

.gameplay-scroll-nav{
  position: fixed;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.scroll-nav-btn{
  width: 48px;
  height: 48px;
  border: 1px solid rgba(40,255,170,0.28);
  background: rgba(6, 10, 20, 0.88);
  color: rgba(232,255,245,0.92);
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  touch-action: none;
  transition: background .15s ease, border-color .15s ease, transform .12s ease;
}

.scroll-nav-btn:hover{
  background: rgba(10, 18, 30, 0.95);
  border-color: rgba(55,242,161,0.5);
}

.scroll-nav-btn:active{
  transform: scale(0.95);
}

#scroll-up-btn{
  border-radius: 14px 14px 0 0;
}

#scroll-down-btn{
  border-radius: 0 0 14px 14px;
  border-top: 0;
}

body.landing-active .gameplay-scroll-nav{
  display: none;
}

@media (max-width: 980px){
  .gameplay-scroll-nav{
    right: 10px;
  }

  .scroll-nav-btn{
    width: 42px;
    height: 42px;
    font-size: 16px;
  }
}

.mono{ font-family: var(--mono); }
.muted{ color: var(--muted); }

.kbd{
  font-family: var(--mono);
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 12px;
  border: 1px solid rgba(40,255,170,0.14);
  background: rgba(0,0,0,.30);
  color: rgba(232,255,245,0.78);
}

.row{ display:flex; flex-wrap:wrap; gap:10px; align-items:center; justify-content:space-between; }

.cards{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
@media (max-width:900px){ .cards{ grid-template-columns: 1fr; } }

.card{
  background: var(--panel2);
  border: 1px solid rgba(120,140,170,0.16);
  border-radius: 16px;
  padding: 14px;
}
.card h4{
  margin:0;
  font-size: 12px;
  font-family: var(--mono);
  color: rgba(232,255,245,0.70);
  letter-spacing: .02em;
}
.value{
  margin-top: 8px;
  font-size: 34px;
  font-weight: 900;
  font-family: var(--mono);
  color: rgba(232,255,245,0.96);
  text-shadow: 0 0 22px rgba(55,242,161,0.10);
}
.small{
  margin-top: 6px;
  font-size: 12px;
  font-family: var(--mono);
  color: rgba(232,255,245,0.62);
}

.status{
  margin-top: 12px;
  border-radius: 16px;
  border: 1px solid rgba(40,255,170,0.12);
  background: rgba(0,0,0,.30);
  padding: 12px 12px;
  font-family: var(--mono);
  font-size: 12px;
  color: rgba(232,255,245,0.76);
  line-height: 1.35;
}
.status.err{
  border-color: rgba(239,68,68,0.20);
  color: rgba(255,210,220,0.95);
}

.tablewrap{
  border-radius: 16px;
  border: 1px solid rgba(120,140,170,0.16);
  overflow:hidden;
  background: rgba(0,0,0,.28);
}
table{
  width:100%;
  border-collapse: collapse;
  font-family: var(--mono);
}
thead th{
  padding: 12px 12px;
  font-size: 12px;
  color: rgba(232,255,245,0.65);
  background: rgba(0,0,0,.30);
  text-align:left;
}
tbody td{
  padding: 12px 12px;
  border-top: 1px solid rgba(120,140,170,0.12);
  font-size: 13px;
}
tbody tr:hover td{
  background: rgba(55,242,161,0.06);
}
.right{ text-align:right; }

.hidden{ display:none !important; }

/* Title decode animation caret */
.caret::after{
  content:"▍";
  margin-left:6px;
  opacity:1;
  animation: caretBlink 1s steps(1) infinite;
}
@keyframes caretBlink{ 50%{ opacity:0; } }

/* ===== Ticker Tape (fixed height, scrolling, no wrapping) ===== */
.ticker{
  border-top: 1px solid rgba(40,255,170,0.10);
  background: rgba(0,0,0,0.55);
}

.ticker-viewport{
  height: 38px;                 /* ✅ fixed height so it NEVER pushes page down */
  overflow: hidden;             /* ✅ hides offscreen items */
  display:flex;
  align-items:center;
}
.ticker-track{
  display: inline-flex;
  flex-wrap: nowrap;
  white-space: nowrap;
  align-items: center;
  gap: 22px;
  padding-left: 14px;
  will-change: transform;
}
@keyframes tickerMove{
  from { transform: translateX(0); }
  to   { transform: translateX(-25%); }      /* ✅ seamless loop with duplicated content */
}

.ticker-item{
  display:inline-flex;
  align-items:center;
  gap:10px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1;
  color: rgba(232,255,245,0.78);
  flex: 0 0 auto;              /* ✅ don’t shrink, don’t stretch, don’t wrap */
}

.ticker-sym{
  color: rgba(232,255,245,0.95);
  font-weight: 800;
  letter-spacing: .03em;
}

.ticker-up{ color: rgba(34,197,94,0.95); }
.ticker-down{ color: rgba(239,68,68,0.95); }

.ticker-dot{
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(55,242,161,0.60);
  box-shadow: 0 0 14px rgba(55,242,161,0.22);
}

.ticker-sep{
  opacity: 0.25;
}
/* How it works page */
.docs-page{
  min-height: 100%;
  background: #020303;
}

.docs-container{
  position: relative;
  z-index: 1;
}

.docs-content{
  line-height: 1.7;
  max-width: 90ch;
}

.docs-page .panel{
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.docs-content p{
  margin: 0 0 14px;
  color: rgba(232,255,245,0.9);
}

.docs-content h3{
  margin: 20px 0 8px;
  font-size: 17px;
  letter-spacing: 0.01em;
}


.docs-content .arch-diagram{
  margin: 12px 0 10px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(40,255,170,0.16);
  background: rgba(0,0,0,0.34);
  color: rgba(232,255,245,0.92);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.55;
  overflow-x: auto;
}

.docs-content .diagram-caption{
  margin: 0 0 14px;
  font-size: 12.5px;
  color: rgba(232,255,245,0.78);
  font-family: var(--mono);
}
.terminal-bg{
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  background:
    radial-gradient(900px 500px at 80% -10%, rgba(18, 69, 48, 0.20), transparent 60%),
    radial-gradient(1000px 600px at 10% 110%, rgba(18, 69, 48, 0.16), transparent 65%),
    #030504;
}

.terminal-line{
  position: absolute;
  top: 100%;
  color: rgba(255, 255, 255, 0.7);
  font-family: var(--mono);
  white-space: nowrap;
  text-shadow: 0 0 8px rgba(90, 255, 160, 0.16);
  transform: translateX(-50%);
  animation-name: terminalScroll;
  animation-timing-function: linear;
}
.input{
  width:100%;
  appearance:none;
  border: 1px solid rgba(40,255,170,0.16);
  background: rgba(0,0,0,.32);
  color: rgba(232,255,245,0.95);
  font-family: var(--mono);
  font-size: 13px;
  padding: 10px 12px;
  border-radius: 14px;
  outline: none;
}

.input:focus{
  border-color: rgba(55,242,161,0.34);
  box-shadow: 0 0 0 3px rgba(55,242,161,0.08);
}

@keyframes terminalScroll {
  from { transform: translate(-50%, 0); }
  to { transform: translate(-50%, -120vh); }
}



.screen-loader{
  position: fixed;
  inset: 0;
  z-index: 120;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s linear;
}

.screen-loader::before{
  content:"";
  position:absolute;
  inset:0;
  background-image: linear-gradient(to bottom, rgba(255,255,255,0.08) 1px, transparent 1px);
  background-size: 100% 3px;
  opacity: 0.08;
  pointer-events:none;
}

.screen-loader.visible{
  opacity: 1;
  pointer-events: all;
}

.loader-desktop{
  position: relative;
  width: 100%;
  height: 100%;
}

.term-window{
  position: absolute;
  width: min(48vw, 620px);
  min-height: 290px;
  border: 1px solid rgba(255,255,255,0.42);
  background: #020202;
  color: #fff;
  box-shadow: 0 26px 52px rgba(0,0,0,0.76);
}

.term-titlebar{
  height: 30px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  padding: 0 10px;
  border-bottom: 1px solid rgba(255,255,255,0.28);
  background: #111;
  cursor: grab;
  user-select:none;
}

.term-title{
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.term-controls{
  display:flex;
  gap:6px;
}

.term-control-btn{
  width: 20px;
  height: 20px;
  padding: 0;
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: 0;
  background: #000;
  color: #fff;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
}

.term-control-btn:hover{
  background: #fff;
  color: #000;
}

.term-body{
  padding: 12px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.45;
}


.term-logbox{
  height: 152px;
  padding: 2px 0 0;
  overflow: hidden;
  margin-top: 6px;
}


.term-cursor{
  animation: termCursorBlink 0.8s steps(1, end) infinite;
}

@keyframes termCursorBlink{
  0%, 45% { opacity: 1; }
  46%, 100% { opacity: 0; }
}

.term-logline{
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
  margin: 0 0 5px;
  opacity: 0.95;
}

.term-line{ margin-bottom: 8px; }
.term-line.muted{ opacity: .76; }

.term-progress-rect{
  height: 12px;
  border: 1px solid rgba(255,255,255,0.6);
  background: #000;
  border-radius: 0;
  overflow: hidden;
  margin: 10px 0 8px;
}

.term-progress-rect-fill{
  width: 0%;
  height: 100%;
  background: #fff;
}

.term-hash{
  letter-spacing: 0.02em;
  font-size: 14px;
}

@media (max-width: 980px){
  .term-window{
    width: min(92vw, 620px);
  }
}
