@font-face {
  font-family: "TermMono";
  src: local("Cascadia Mono"), local("Cascadia Code"), local("Consolas");
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  background: #000;
  overflow: hidden;
}

body {
  font-family: "Cascadia Mono", "Cascadia Code", Consolas, "Courier New", monospace;
  color: #cccccc;
}

#crt {
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
}

#window {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* ---------- title bar ---------- */

#titlebar {
  height: 38px;
  background: #1b1b1b;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  border-bottom: 1px solid #000;
  user-select: none;
  flex: none;
}

.tabs {
  display: flex;
  align-items: flex-end;
  height: 100%;
  padding-left: 6px;
}

.tab {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 10px;
  background: #2b2b2b;
  border-radius: 6px 6px 0 0;
  font-size: 12.5px;
  color: #e8e8e8;
}

.tab-icon {
  background: #111;
  color: #7fdc7f;
  font-size: 10px;
  padding: 1px 3px;
  border-radius: 2px;
}

.tab-close {
  margin-left: 6px;
  color: #888;
  font-size: 13px;
  line-height: 1;
}

.tab-close:hover {
  color: #fff;
}

.tab-new {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  color: #999;
  font-size: 16px;
}

.tab-new:hover {
  background: #2b2b2b33;
  color: #fff;
}

.titlebar-right {
  display: flex;
  align-items: center;
  height: 100%;
}

.lang-switch {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 4px;
  padding: 0 10px;
  font-size: 12px;
  color: #777;
  user-select: none;
}

.lang-opt {
  cursor: pointer;
  padding: 2px 5px;
  border-radius: 3px;
}

.lang-opt:hover {
  background: #333;
  color: #eaeaea;
}

.lang-opt.active {
  color: #eaeaea;
  font-weight: bold;
}

.lang-sep {
  color: #555;
}

.win-controls {
  display: flex;
  height: 100%;
  padding-bottom: 0;
}

.win-btn {
  width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: #ccc;
  cursor: pointer;
}

.win-btn:hover {
  background: #333;
}

.win-close:hover {
  background: #c42b1c;
  color: #fff;
}

/* ---------- terminal body ---------- */

#term-wrap {
  flex: 1;
  min-height: 0;
  background:
    radial-gradient(ellipse at 20% 100%, rgba(30, 70, 45, 0.35) 0%, rgba(0,0,0,0) 45%),
    radial-gradient(ellipse at 85% 100%, rgba(20, 60, 40, 0.28) 0%, rgba(0,0,0,0) 45%),
    #0c0c0c;
}

#term {
  height: 100%;
  overflow-y: auto;
  padding: 14px 18px 24px;
  font-size: 15px;
  line-height: 1.5;
  outline: none;
  cursor: text;
}

#term::-webkit-scrollbar {
  width: 10px;
}
#term::-webkit-scrollbar-thumb {
  background: #333;
}
#term::-webkit-scrollbar-track {
  background: transparent;
}

#output > div {
  white-space: pre-wrap;
  word-break: break-word;
}

.line-dim {
  color: #9a9a9a;
}

.line-hint {
  color: #6f6f6f;
  font-style: italic;
}

.line-err {
  color: #f2555a;
}

.prompt-echo {
  color: #eaeaea;
}

.ps-user {
  color: #7fdc7f;
  font-weight: bold;
}

.ps-path {
  color: #6fb7ff;
  font-weight: bold;
}

#input-line {
  display: flex;
  flex-wrap: wrap;
  color: #eaeaea;
}

#prompt-path {
  white-space: pre;
}

#typed {
  white-space: pre-wrap;
  word-break: break-word;
}

.cursor {
  display: inline-block;
  width: 9px;
  margin-left: 1px;
  animation: blink 1s steps(1) infinite;
  color: #eaeaea;
}

#hint {
  margin-left: 10px;
  color: #6f6f6f;
  font-style: italic;
  pointer-events: none;
  display: none;
}

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

/* entries in listings */

.entry {
  cursor: pointer;
  text-decoration: none;
}

.entry:hover {
  text-decoration: underline;
}

.entry-dir {
  color: #6fb7ff;
  font-weight: bold;
}

.entry-link {
  color: #3ddc73;
  font-weight: bold;
}

.perm {
  color: #7a7a7a;
  display: inline-block;
  min-width: 100px;
}

.neofetch {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  align-items: flex-start;
}

.nf-logo {
  color: #6fb7ff;
  font-weight: bold;
  font-family: inherit;
  line-height: 1.15;
  margin: 0;
}

.nf-header {
  color: #7fdc7f;
  font-weight: bold;
}

.nf-sep {
  color: #555;
}

.nf-label {
  color: #8a8a8a;
  display: inline-block;
  min-width: 90px;
}

.sec-title {
  color: #6fb7ff;
  font-weight: bold;
}

#ghost-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
}

#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1f1f1f;
  border: 1px solid #3a3a3a;
  color: #eaeaea;
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 13px;
  opacity: 0;
  transition: opacity .25s ease, transform .25s ease;
  pointer-events: none;
}

#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 640px) {
  #term {
    font-size: 13px;
    padding: 10px 12px 18px;
  }
  .perm {
    min-width: 76px;
  }
  .lang-switch {
    padding: 0 6px;
  }
}
