:root{
  --bg: #0b1020;
  --panel: rgba(15, 23, 42, .72);
  --border: rgba(148, 163, 184, .18);
  --text: #cbd5e1;
  --muted: #8aa0b8;
  --accent: #39ff88;
  --accent2: #60a5fa;
  --shadow: 0 20px 60px rgba(0,0,0,.45);
  --radius: 18px;
  --font: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

*{ box-sizing:border-box; font-family: var(--font); }
html,body{ height:100%; }

body{
  margin:0;
  color: var(--text);
  background:
    radial-gradient(1200px 800px at 20% 10%, rgba(56,189,248,.12), transparent 60%),
    radial-gradient(900px 600px at 80% 20%, rgba(57,255,136,.10), transparent 55%),
    radial-gradient(1000px 800px at 50% 90%, rgba(99,102,241,.08), transparent 60%),
    var(--bg);
  padding: 22px;
  padding-bottom: 88px; /* spazio per il footer fisso */
}

.wrap{
  max-width: 980px;
  margin: 0 auto;
  min-height: 100vh;
  display:flex;
  align-items: center;
  justify-content: center;
}

/* Terminal a dimensione fissa */
.terminal{
  width: 100%;
  height: 75vh;
  max-height: 75vh;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;            /* bordi arrotondati */
  backdrop-filter: blur(12px);

  display:flex;               /* ✅ layout corretto */
  flex-direction: column;     /* topbar -> screen -> inputbar */
  position: relative; /* necessario per posizionare footer assoluto */
}

.topbar{
  display:flex;
  align-items:center;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(2, 6, 23, .35);
}

.dots{ display:flex; gap:8px; }
.dot{ width:10px; height:10px; border-radius:50%; opacity:.9; }
.dot.red{ background:#ff5f56; }
.dot.yellow{ background:#ffbd2e; }
.dot.green{ background:#27c93f; }

.title{
  font-weight: 600;
  letter-spacing: .2px;
  color: rgba(226,232,240,.9);
  font-size: 14px;
  user-select:none;
}

.hint{
  margin-left:auto;
  color: rgba(148,163,184,.9);
  font-size: 12px;
}

.kbd{
  padding: 2px 6px;
  border: 1px solid rgba(148,163,184,.18);
  border-radius: 8px;
  background: rgba(2,6,23,.25);
  color: rgba(226,232,240,.95);
}

/* ✅ SOLO lo screen scrolla, e si “mangia” lo spazio vuoto */
.screen{
  flex: 1;
  min-height: 0;             /* IMPORTANTISSIMO in flex */
  overflow-y: auto;
  overflow-x: hidden;
  padding: 18px 18px 80px;
  line-height: 1.55;
  font-size: 15px;
}

/* scrollbar carina */
.screen{
  scrollbar-width: thin; /* firefox */
  scrollbar-color: rgba(148,163,184,.35) transparent;
}
.screen::-webkit-scrollbar{ width: 10px; }
.screen::-webkit-scrollbar-track{ background: transparent; }
.screen::-webkit-scrollbar-thumb{
  background: rgba(148,163,184,.28);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
.screen::-webkit-scrollbar-thumb:hover{
  background: rgba(148,163,184,.40);
  border: 2px solid transparent;
  background-clip: padding-box;
}

.line{
  display:flex;
  flex-wrap:wrap;
  gap: 6px;
  align-items: baseline;
  margin: 8px 0 6px;
}

.prompt{ color: var(--accent); text-shadow: 0 0 12px rgba(57,255,136,.18); }
.path{ color: rgba(96,165,250,.95); }
.sep{ color: rgba(148,163,184,.8); }
.cmd{ color: rgba(226,232,240,.95); }

.out{
  margin: 0 0 14px;
  padding-left: 14px;
  white-space: pre-wrap;
  /* border-left: 2px solid rgba(148,163,184,.16); */
}

.accent{ color: var(--accent); }
.muted{ color: var(--muted); }

.pill{
  display:inline-flex;
  padding: 8px 10px;
  border: 1px solid rgba(148,163,184,.18);
  border-radius: 999px;
  text-decoration:none;
  color: rgba(226,232,240,.95);
  background: rgba(2,6,23,.25);
  margin: 4px 8px 0 0;
}

.hr{
  height: 1px;
  background: rgba(148,163,184,.16);
  margin: 12px 0;
}

/* Footer sticky: rimane attaccato al fondo dello "screen",
   quindi appare sopra l'inputbar (riga di comando) */
.myFooter{
  position: absolute;
  left: 0;
  right: 0;
  bottom: 56px; /* distanza sopra l'inputbar */
  z-index: 2;
  margin: 0;
  padding: 8px 18px;
  background: linear-gradient(180deg, transparent, rgba(2,6,23,.02));
}

a{ color: rgba(96,165,250,.95); }
a:hover{ color: #93c5fd; }

pre{ max-width: 100%; overflow-x: auto; }
pre.ascii{ margin:0; white-space: pre; letter-spacing: 0; line-height: 1.05; }

/* input fisso in basso (non sticky: è l’ultimo elemento del flex) */
.inputbar{
  display:flex;
  gap: 6px;
  align-items: baseline;
  padding: 10px 16px 14px;
  border-top: 1px solid rgba(148,163,184,.14);
  background: rgba(2, 6, 23, .25);
}

.cmdline{
  flex: 1;
  background: transparent;
  border: 0;
  outline: 0;
  color: rgba(226,232,240,.95);
  font-size: 15px;
  padding: 0;
  caret-color: var(--accent);
}

@media (max-width: 520px){
  body{ padding: 12px; }
  .terminal{ height: 82vh; max-height: 82vh; }
  .screen{ padding: 14px 14px 6px; font-size: 14px; }
  .cmdline{ font-size: 14px; }
  .title{ font-size: 13px; }
}


body {
  background: var(--bg);
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;

  background:
    radial-gradient(1200px 800px at 20% 10%, rgba(56,189,248,.12), transparent 60%),
    radial-gradient(900px 600px at 80% 20%, rgba(57,255,136,.10), transparent 55%),
    radial-gradient(1000px 800px at 50% 90%, rgba(99,102,241,.08), transparent 60%),
    var(--bg);

  background-repeat: no-repeat;
  background-size: cover; /* oppure 100% 100% */
  transform: translateZ(0); /* riduce flicker su alcuni browser */
}

  /* Footer fisso in fondo alla pagina (fuori dalla finestra terminal) */
  .pageFooter{
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    background: rgba(2,6,23,.55);
    backdrop-filter: blur(6px);
    border-top: 1px solid rgba(148,163,184,.06);
    box-shadow: 0 -6px 18px rgba(2,6,23,.25);
  }
  .pageFooter a{ color: rgba(96,165,250,.95); }
  .pageFooter .kbd{ padding:2px 6px; border-radius:6px; border:1px solid rgba(148,163,184,.12); background: rgba(2,6,23,.18); }

  @media (max-width:520px){
    .pageFooter div{ padding-left:12px; padding-right:12px; font-size:13px; }
  }