/* Cyber Clicker — neon UI
   Works offline. No external deps.
*/

:root{
  --bg:#05070b;
  --bg2:#060c10;
  --neon:#00ffc6;
  --neon2:#8a2eff;
  --red:#ff3b6b;
  --txt:#e8f6ff;
  --muted:#9bb7c6;
  --card:rgba(10,18,24,.72);
  --stroke:rgba(0,255,198,.22);
  --shadow: 0 0 25px rgba(0,255,198,.18), 0 0 60px rgba(138,46,255,.10);
  --radius:18px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  color:var(--txt);
  background: radial-gradient(1000px 600px at 30% 30%, rgba(0,255,198,.08), transparent 60%),
              radial-gradient(900px 500px at 70% 60%, rgba(138,46,255,.08), transparent 55%),
              linear-gradient(180deg, var(--bg), var(--bg2));
  overflow-x:hidden;
}

.bg{
  position:fixed; inset:0;
  background:
    radial-gradient(900px 500px at 20% 20%, rgba(0,255,198,.08), transparent 60%),
    radial-gradient(700px 400px at 80% 30%, rgba(138,46,255,.08), transparent 60%),
    radial-gradient(800px 500px at 60% 80%, rgba(0,255,198,.05), transparent 65%);
  filter: blur(0px);
  z-index:-3;
}
.grain{
  position:fixed; inset:0;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)' opacity='.25'/%3E%3C/svg%3E");
  mix-blend-mode:overlay;
  opacity:.16;
  z-index:-2;
  pointer-events:none;
}

.topbar{
  position:sticky; top:0;
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 18px;
  background: linear-gradient(180deg, rgba(5,7,11,.92), rgba(5,7,11,.70));
  border-bottom:1px solid rgba(0,255,198,.12);
  backdrop-filter: blur(10px);
  z-index:5;
}

.brand{
  font-weight:900;
  letter-spacing:.08em;
  user-select:none;
}
.brand span{ color:var(--neon);}
.brand em{
  font-style:normal;
  font-weight:700;
  margin-left:10px;
  letter-spacing:.02em;
  color:rgba(232,246,255,.72);
}

.hud{
  display:flex; gap:10px;
  padding:8px;
  border-radius:14px;
  border:1px solid rgba(0,255,198,.14);
  background: rgba(0,0,0,.25);
  box-shadow: var(--shadow);
}
.hudBox{
  width:84px;
  border-radius:12px;
  padding:8px 10px;
  border:1px solid rgba(0,255,198,.12);
  background: rgba(10,18,24,.55);
}
.hudLabel{font-size:11px; color:rgba(232,246,255,.65)}
.hudVal{font-weight:800; color:var(--neon); margin-top:2px}

.topActions{display:flex; gap:10px}
.btn{
  border:1px solid rgba(0,255,198,.22);
  background: rgba(10,18,24,.55);
  color:var(--txt);
  padding:10px 12px;
  border-radius:14px;
  cursor:pointer;
  transition: transform .08s ease, border-color .15s ease, box-shadow .15s ease;
  box-shadow: 0 0 0 rgba(0,0,0,0);
}
.btn:hover{
  border-color: rgba(0,255,198,.45);
  box-shadow: 0 0 18px rgba(0,255,198,.14);
}
.btn:active{ transform: translateY(1px) scale(.99); }
.btn.ghost{
  width:44px; height:44px;
  display:grid; place-items:center;
  padding:0;
}

.layout{
  max-width: 1200px;
  margin: 18px auto;
  padding: 0 16px 28px;
  display:grid;
  grid-template-columns: 1.25fr .95fr;
  gap:16px;
}

.panel{display:flex; flex-direction:column; gap:16px}
.card{
  background: var(--card);
  border:1px solid rgba(0,255,198,.14);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding:16px;
  backdrop-filter: blur(12px);
}
.card.big{ padding:18px; }

.cardHead{display:flex; align-items:center; justify-content:space-between; gap:12px}
.title{
  margin:0;
  font-size:22px;
  letter-spacing:.16em;
  color: rgba(232,246,255,.9);
  text-shadow: 0 0 18px rgba(138,46,255,.12);
}
.sub{
  color:rgba(232,246,255,.65);
  font-size:13px;
  text-align:right;
  max-width: 420px;
}
.h2{margin:0; font-size:16px; letter-spacing:.06em}
.tiny{font-size:12px; color:rgba(232,246,255,.66); line-height:1.35}

.energyRow{
  margin-top:14px;
  display:grid;
  grid-template-columns: 1.25fr .75fr;
  gap:12px;
}
.energy{
  border-radius: 16px;
  padding:14px;
  border:1px solid rgba(0,255,198,.14);
  background: rgba(0,0,0,.22);
}
.energyLabel{font-size:12px; color:rgba(232,246,255,.65); letter-spacing:.1em}
.energyValue{
  font-size: 34px;
  font-weight: 1000;
  color: var(--neon);
  margin:6px 0;
  text-shadow: 0 0 22px rgba(0,255,198,.22);
  font-variant-numeric: tabular-nums;
}
.energyMeta{
  display:flex; align-items:center; gap:10px;
  color:rgba(232,246,255,.62);
  font-size:12px;
}
.dot{width:4px;height:4px;border-radius:10px;background:rgba(232,246,255,.35)}

.stats{
  display:grid;
  gap:10px;
}
.stat{
  border-radius: 16px;
  padding:12px 12px;
  border:1px solid rgba(0,255,198,.12);
  background: rgba(0,0,0,.18);
}
.statLabel{font-size:12px;color:rgba(232,246,255,.62)}
.statValue{font-weight:900;color:rgba(232,246,255,.92);margin-top:4px}

.coreWrap{
  position:relative;
  margin-top:18px;
  padding:16px 0 6px;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:12px;
}
.core{
  width: 220px;
  height: 220px;
  border-radius: 999px;
  border:1px solid rgba(0,255,198,.28);
  background: radial-gradient(circle at 30% 30%, rgba(0,255,198,.14), rgba(0,0,0,.45) 55%, rgba(138,46,255,.10));
  box-shadow: 0 0 28px rgba(0,255,198,.18), 0 0 70px rgba(138,46,255,.12);
  cursor:pointer;
  position:relative;
  overflow:hidden;
  transition: transform .08s ease;
}
.core:active{ transform: scale(.985); }
.coreRing{
  position:absolute; inset:-20%;
  border-radius:999px;
  border: 2px solid rgba(0,255,198,.18);
  filter: blur(.2px);
  animation: spin 6s linear infinite;
}
.coreInner{
  position:absolute; inset:14%;
  border-radius:999px;
  border:1px solid rgba(138,46,255,.25);
  background: radial-gradient(circle at 40% 40%, rgba(138,46,255,.18), rgba(0,0,0,.35));
  box-shadow: inset 0 0 24px rgba(0,255,198,.10);
}
.coreText{
  position:absolute;
  inset:0;
  display:grid;
  place-items:center;
  font-weight:1000;
  letter-spacing:.25em;
  color: rgba(232,246,255,.90);
  text-shadow: 0 0 18px rgba(0,255,198,.18);
}

@keyframes spin{ to{ transform: rotate(360deg); } }

.glitchBanner{
  width:min(520px, 100%);
  border-radius: 16px;
  padding:12px 14px;
  border:1px solid rgba(138,46,255,.26);
  background: rgba(10,18,24,.55);
  opacity:.12;
  transform: translateY(-4px);
  transition: opacity .2s ease, transform .2s ease;
}
.glitchBanner.active{
  opacity:1;
  transform: translateY(0);
  box-shadow: 0 0 26px rgba(138,46,255,.14), 0 0 40px rgba(0,255,198,.08);
}
.glitchTitle{
  font-weight: 1000;
  letter-spacing:.18em;
  color: rgba(232,246,255,.78);
  font-size: 12px;
}
.glitchText{
  margin-top:6px;
  font-size:13px;
  color: rgba(232,246,255,.92);
}
.glitchTimer{
  height:8px;
  margin-top:10px;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  overflow:hidden;
  border:1px solid rgba(0,255,198,.10);
}
.glitchBar{
  height:100%;
  width:0%;
  background: linear-gradient(90deg, rgba(0,255,198,.9), rgba(138,46,255,.9));
}

.foot{
  margin-top:10px;
  display:flex;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
}

.grid2{display:grid; grid-template-columns: 1fr 1fr; gap:10px; margin-top:12px}

.upCard{
  border-radius: 16px;
  padding:12px;
  border:1px solid rgba(0,255,198,.14);
  background: rgba(0,0,0,.18);
  display:flex;
  flex-direction:column;
  gap:8px;
}
.upTop{display:flex; align-items:flex-start; justify-content:space-between; gap:10px}
.upName{font-weight:900; letter-spacing:.05em}
.upDesc{font-size:12px; color:rgba(232,246,255,.62); line-height:1.35}
.upCost{font-size:12px; color:rgba(0,255,198,.9); font-weight:900}
.upBtn{width:100%}

.pill{
  display:flex; align-items:center; gap:10px;
  padding:8px 10px;
  border-radius: 999px;
  border:1px solid rgba(0,255,198,.12);
  background: rgba(0,0,0,.18);
  color: rgba(232,246,255,.70);
  font-size:12px;
}

.switch{position:relative;display:inline-block;width:46px;height:26px}
.switch input{display:none}
.slider{
  position:absolute; cursor:pointer; inset:0;
  background: rgba(255,255,255,.08);
  border:1px solid rgba(0,255,198,.16);
  border-radius:999px;
  transition:.2s ease;
}
.slider:before{
  content:"";
  position:absolute;
  height:20px;width:20px;left:3px;top:2px;
  background: linear-gradient(180deg, rgba(0,255,198,.9), rgba(0,255,198,.35));
  border-radius:999px;
  transition:.2s ease;
  box-shadow: 0 0 18px rgba(0,255,198,.18);
}
.switch input:checked + .slider{
  border-color: rgba(138,46,255,.26);
  box-shadow: 0 0 18px rgba(138,46,255,.12);
}
.switch input:checked + .slider:before{
  transform: translateX(20px);
  background: linear-gradient(180deg, rgba(138,46,255,.9), rgba(0,255,198,.35));
}

.tabs{
  display:flex;
  gap:8px;
  padding:6px;
  border-radius: 16px;
  border:1px solid rgba(0,255,198,.12);
  background: rgba(0,0,0,.18);
}
.tab{
  flex:1;
  border:none;
  cursor:pointer;
  padding:10px 10px;
  border-radius: 14px;
  background: transparent;
  color: rgba(232,246,255,.72);
  font-weight:800;
  letter-spacing:.04em;
}
.tab.active{
  background: rgba(0,255,198,.10);
  border:1px solid rgba(0,255,198,.18);
  color: rgba(232,246,255,.94);
  box-shadow: 0 0 18px rgba(0,255,198,.10);
}

.tabBody{display:none; padding-top:14px}
.tabBody.active{display:block}

.list{display:flex; flex-direction:column; gap:10px}
.row{
  border-radius: 16px;
  padding:12px;
  border:1px solid rgba(0,255,198,.12);
  background: rgba(0,0,0,.18);
  display:grid;
  grid-template-columns: 1fr auto;
  gap:10px;
}
.rowTitle{font-weight:900}
.rowDesc{font-size:12px;color:rgba(232,246,255,.62);margin-top:4px;line-height:1.35}
.rowMeta{display:flex; gap:10px; flex-wrap:wrap; margin-top:8px; font-size:12px; color:rgba(232,246,255,.62)}
.badge{
  padding:4px 8px;
  border-radius: 999px;
  border:1px solid rgba(0,255,198,.14);
  background: rgba(0,0,0,.18);
}
.price{color: rgba(0,255,198,.95); font-weight:900}
.owned{color: rgba(232,246,255,.88); font-weight:900}
.buyBtn{min-width:140px; height:44px; align-self:center}

.sys{display:flex; flex-direction:column; gap:10px}
.sysRow{
  display:flex; justify-content:space-between; gap:12px;
  border-radius: 14px;
  padding:10px 12px;
  border:1px solid rgba(0,255,198,.12);
  background: rgba(0,0,0,.18);
}
.sysName{color:rgba(232,246,255,.68)}
.sysVal{font-weight:900;color:rgba(232,246,255,.92);font-variant-numeric: tabular-nums}

.divider{height:1px;background: rgba(255,255,255,.08); margin:8px 0}

.importExport textarea{
  width:100%;
  height:120px;
  resize:vertical;
  border-radius: 14px;
  border:1px solid rgba(0,255,198,.14);
  background: rgba(0,0,0,.22);
  color: rgba(232,246,255,.90);
  padding:10px;
  outline:none;
  margin-top:10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size:12px;
}

.toast{
  position: fixed;
  right: 16px;
  bottom: 16px;
  max-width: 360px;
  padding:12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(0,255,198,.18);
  background: rgba(10,18,24,.75);
  box-shadow: var(--shadow);
  opacity:0;
  transform: translateY(10px);
  transition: opacity .18s ease, transform .18s ease;
  pointer-events:none;
  z-index:10;
}
.toast.show{
  opacity:1;
  transform: translateY(0);
}

.floatText{
  position: fixed;
  font-weight:1000;
  font-size:14px;
  color: var(--neon);
  text-shadow: 0 0 18px rgba(0,255,198,.22);
  pointer-events:none;
  transform: translate(-50%, -50%);
  z-index:9;
  animation: floatUp .8s ease forwards;
}
@keyframes floatUp{
  0%{ opacity:0; transform: translate(-50%,-50%) scale(.95); }
  10%{ opacity:1; }
  100%{ opacity:0; transform: translate(-50%,-120%) scale(1.04); }
}

@media (max-width: 980px){
  .layout{ grid-template-columns: 1fr; }
  .hud{display:none}
  .sub{text-align:left; max-width:unset}
  .energyRow{grid-template-columns: 1fr}
}
