:root {
  --bg: #08080f;
  --bg-soft: #111119;
  --card: #13131d;
  --border: rgba(255, 255, 255, 0.08);
  --fg: #e6e6f0;
  --muted: #8888a8;
  --accent: #7c6aff;
  --accent2: #c8a97e;
  --err: #ff6b6b;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", "Fira Code",
    "JetBrains Mono", Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  position: relative;
  overflow: hidden;
}

/* Ambient background glow, echoes the original xhtechstudio palette */
body::before,
body::after {
  content: "";
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
}
body::before {
  width: 420px;
  height: 420px;
  left: 8%;
  top: 12%;
  background: radial-gradient(circle, rgba(124, 106, 255, 0.16), transparent 70%);
}
body::after {
  width: 360px;
  height: 360px;
  right: 6%;
  bottom: 8%;
  background: radial-gradient(circle, rgba(200, 169, 126, 0.14), transparent 70%);
}

.terminal {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 880px;
  height: min(78vh, 640px);
  display: flex;
  flex-direction: column;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.02);
  overflow: hidden;
}

.titlebar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  font-size: 12px;
  color: var(--muted);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3ddc84;
  box-shadow: 0 0 8px #3ddc84;
  animation: pulse 2.2s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}

.titlebar span.path {
  color: var(--fg);
  opacity: 0.7;
}

#screen {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px;
  font-size: 14px;
  line-height: 1.6;
}

.line {
  white-space: pre-wrap;
  word-break: break-word;
}

.line.err {
  color: var(--err);
}

.line.muted,
.muted {
  color: var(--muted);
}

.prompt {
  color: var(--accent2);
  font-weight: 600;
}

.c-dir {
  color: var(--accent);
  font-weight: 600;
}

.c-file {
  color: var(--fg);
}

a {
  color: var(--accent2);
  text-decoration: underline;
  text-decoration-color: rgba(200, 169, 126, 0.4);
}
a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

.input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px 16px;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.015);
}

#prompt-label {
  color: var(--accent2);
  font-weight: 600;
  white-space: nowrap;
  font-size: 14px;
}

#cmd-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 14px;
  caret-color: var(--accent);
}

#screen::-webkit-scrollbar {
  width: 8px;
}
#screen::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

@media (max-width: 640px) {
  body {
    padding: 0;
  }
  .terminal {
    max-width: 100%;
    height: 100vh;
    border-radius: 0;
  }
  #cmd-input {
    font-size: 16px; /* avoid iOS zoom-on-focus */
  }
}
