:root{
  --bg:#050a07;
  --panel:rgba(10,20,14,.72);
  --line:rgba(120,255,170,.35);
  --g1:#63ff9e;
  --g2:#32ff7a;
  --muted:rgba(160,255,200,.55);
  --shadow:0 14px 40px rgba(0,0,0,.55);
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:"Share Tech Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  color:var(--g1);
  background:
    radial-gradient(1200px 700px at 50% 10%, rgba(40,255,120,.10), transparent 60%),
    radial-gradient(900px 600px at 70% 60%, rgba(40,255,120,.07), transparent 60%),
    #000;
  overflow-x:hidden;
}
a{color:inherit}
.muted{color:var(--muted)}
/* Boot overlay */
.boot{
  position:fixed; inset:0;
  display:flex; align-items:center; justify-content:center;
  padding:24px;
  background:rgba(0,0,0,.88);
  backdrop-filter: blur(4px);
  z-index:50;
}
.boot.hidden{display:none}
.boot-card{
  width:min(720px, 96vw);
  background:linear-gradient(180deg, rgba(10,18,12,.85), rgba(4,10,7,.78));
  border:1px solid var(--line);
  border-radius:18px;
  box-shadow: var(--shadow);
  padding:18px 18px 16px;
}
.boot-title{letter-spacing:.12em}
.boot-sub{margin-top:6px;color:var(--muted);font-size:14px}
.boot-log{
  margin-top:14px;
  height:180px;
  overflow:auto;
  padding:12px;
  border:1px solid var(--line);
  border-radius:14px;
  background:rgba(0,0,0,.45);
  font-size:14px;
}
.boot-progress{margin-top:14px}
.boot-progress-bar{
  height:10px; border-radius:999px;
  background:rgba(120,255,170,.12);
  border:1px solid rgba(120,255,170,.25);
  overflow:hidden;
}
.boot-progress-fill{
  height:100%;
  background:linear-gradient(90deg, rgba(90,255,160,.35), rgba(60,255,120,.85));
}
.boot-progress-meta{
  display:flex; justify-content:space-between; align-items:center;
  margin-top:10px;
  font-size:14px;
}
.unlock{
  margin-top:14px;
  width:100%;
  border-radius:14px;
  padding:12px 14px;
  border:1px solid rgba(120,255,170,.45);
  background:rgba(0,0,0,.35);
  color:var(--g2);
  cursor:pointer;
  letter-spacing:.12em;
}
.unlock:hover{background:rgba(0,0,0,.55)}
/* App layout */
.app{width:min(1180px, 96vw); margin:0 auto; padding:18px 0 30px}
.top{
  position:relative;
  display:flex; align-items:flex-start; justify-content:space-between;
  gap:14px;
  padding:14px 14px 10px;
  border:1px solid var(--line);
  border-radius:18px;
  background:var(--panel);
  box-shadow: var(--shadow);
}
.brand-title{font-size:18px}
.brand-sub{margin-top:2px; font-size:14px; color:var(--muted)}
.top-right{display:flex; align-items:center; gap:10px; flex-wrap:wrap; justify-content:flex-end}
.pill{
  padding:10px 12px;
  border-radius:999px;
  border:1px solid rgba(120,255,170,.35);
  background:rgba(0,0,0,.28);
  font-size:14px;
}
.gear{
  width:46px; height:46px; border-radius:14px;
  border:1px solid rgba(120,255,170,.35);
  display:flex; align-items:center; justify-content:center;
  background:rgba(0,0,0,.28);
}
.gear-dot{width:10px;height:10px;border-radius:50%;background:rgba(120,255,170,.6)}
.clock{
  position:absolute;
  right:14px;
  bottom:-28px;
  font-size:13px;
  color:var(--muted);
}
.terminal{
  margin-top:34px;
  padding:14px;
  border:1px solid var(--line);
  border-radius:18px;
  background:var(--panel);
  box-shadow: var(--shadow);
}
.term-line{font-size:14px; margin:6px 0}
.term-input{
  margin-top:10px;
  display:flex;
  align-items:center;
  gap:10px;
  border:1px solid rgba(120,255,170,.30);
  border-radius:14px;
  padding:12px;
  background:rgba(0,0,0,.30);
}
.prompt{color:var(--g2)}
.typed{white-space:pre}
.term-stats{
  margin-top:10px;
  font-size:13px;
  color:var(--muted);
  display:flex; justify-content:flex-end;
}
.connect{margin-top:18px; text-align:center}
.connect h2{margin:0; font-size:44px; letter-spacing:.18em; text-shadow:0 0 24px rgba(60,255,130,.45)}
.connect-sub{margin-top:8px; color:var(--muted)}
.grid{
  margin-top:18px;
  display:grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap:14px;
}
@media (max-width: 860px){
  .grid{grid-template-columns:1fr}
  .connect h2{font-size:34px}
}
.card{
  border:1px solid rgba(120,255,170,.33);
  border-radius:18px;
  background:rgba(0,0,0,.24);
  box-shadow: var(--shadow);
  padding:14px;
  position:relative;
  overflow:hidden;
}
.card:before{
  content:"";
  position:absolute; inset:0;
  background:
    repeating-linear-gradient(0deg, rgba(80,255,140,.08) 0, rgba(80,255,140,.08) 2px, transparent 2px, transparent 18px);
  opacity:.25;
  pointer-events:none;
}
.card-top{position:relative; display:flex; align-items:center; justify-content:space-between; gap:12px}
.card-icon{
  width:56px;height:56px;border-radius:16px;
  border:1px solid rgba(120,255,170,.33);
  display:flex; align-items:center; justify-content:center;
  background:rgba(0,0,0,.25);
  font-size:20px;
  flex:0 0 auto;
}
.card-meta{min-width:0}
.card-title{margin:0; font-size:22px}
.card-handle{margin-top:6px; color:var(--muted)}
.card-actions{display:flex; gap:8px; flex:0 0 auto}
.icon-btn{
  width:40px;height:40px;border-radius:12px;
  border:1px solid rgba(120,255,170,.33);
  background:rgba(0,0,0,.25);
  color:var(--g2);
  cursor:pointer;
}
.icon-btn:hover{background:rgba(0,0,0,.45)}
.cmd{
  position:relative;
  margin-top:12px;
  display:flex; align-items:center; justify-content:space-between;
  gap:10px;
  border:1px solid rgba(120,255,170,.25);
  border-radius:14px;
  padding:10px 10px;
  background:rgba(0,0,0,.28);
}
.cmd-text{color:rgba(180,255,210,.85); font-size:14px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.open-btn{
  border-radius:12px;
  padding:10px 12px;
  border:1px solid rgba(120,255,170,.35);
  background:rgba(0,0,0,.25);
  color:var(--g2);
  cursor:pointer;
  letter-spacing:.08em;
}
.open-btn:hover{background:rgba(0,0,0,.45)}
.foot{margin-top:18px; color:var(--muted); text-align:center; font-size:13px}
/* Modal */
.modal{
  position:fixed; inset:0;
  display:none;
  align-items:center; justify-content:center;
  background:rgba(0,0,0,.75);
  padding:22px;
  z-index:80;
}
.modal.show{display:flex}
.modal-card{
  width:min(420px, 96vw);
  background:linear-gradient(180deg, rgba(10,18,12,.92), rgba(0,0,0,.86));
  border:1px solid rgba(120,255,170,.35);
  border-radius:18px;
  box-shadow: var(--shadow);
  padding:14px;
}
.modal-head{display:flex; align-items:center; justify-content:space-between; gap:10px}
.modal-title{font-size:16px; letter-spacing:.12em}
.modal-close{
  width:40px;height:40px;border-radius:12px;
  border:1px solid rgba(120,255,170,.35);
  background:rgba(0,0,0,.25);
  color:var(--g2);
  cursor:pointer;
}
.modal-body{margin-top:12px; text-align:center}
.qr{display:flex; justify-content:center; margin:10px 0}
.modal-url{color:var(--muted); font-size:12px; word-break:break-all}
.modal-actions{display:flex; gap:10px; justify-content:center; margin-top:12px; flex-wrap:wrap}
.btn{
  border-radius:12px;
  padding:10px 12px;
  border:1px solid rgba(120,255,170,.35);
  background:rgba(0,0,0,.25);
  color:var(--g2);
  cursor:pointer;
}
.btn:hover{background:rgba(0,0,0,.45)}


/* Matrix rain canvas (fixed speed) */
#matrixRain{
  position:fixed;
  inset:0;
  width:100%;
  height:100%;
  z-index:0;
  pointer-events:none;
  opacity:0.65;
}

/* Ensure app UI stays above rain */
#bootOverlay, #app{ position:relative; z-index:1; }

/* Boot overlay should sit centered on-screen (desktop + mobile)
   and remain translucent so the rain effect is visible behind it. */
#bootOverlay{
  position: fixed;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 16px;
  background: rgba(0,0,0,.35);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

@media (max-width: 600px){
  #bootCard{ width: min(520px, 92vw); }
}
