﻿:root {
  --bg: #0a0a0a;
  --surface: #000000;
  --text: #c9c9c9;
  --muted: #8a8a8a;
  --accent: #4af626;
  --accent-soft: rgba(74, 246, 38, 0.35);
  --today-accent: #9fff8b;
  --border: #2a2a2a;
  --selection-bg: rgba(74, 246, 38, 0.35);
  --selection-text: #001b04;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "JetBrains Mono", Consolas, "Courier New", monospace;
  color: var(--text);
  background: var(--bg);
}

.app {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(900px, calc(100% - 2.5rem));
  height: 360px;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 0;
  background: var(--surface);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
  overflow: hidden;
}

.app.theme-powershell {
  --accent: #7ed6ff;
  --accent-soft: rgba(126, 214, 255, 0.35);
  --today-accent: #d6f2ff;
  --selection-bg: rgba(126, 214, 255, 0.35);
  --selection-text: #001825;
  --surface: #050b12;
}

.titlebar {
  height: 34px;
  display: flex;
  align-items: center;
  padding: 0 0.75rem;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  background: #111111;
  font-size: 0.8rem;
}

.window-controls {
  margin-left: auto;
  display: flex;
  align-items: center;
  height: calc(100% + 1px);
  margin-right: -0.75rem;
}

.win-btn {
  width: 46px;
  height: 100%;
  border: 0;
  border-left: 1px solid var(--border);
  background: #111111;
  color: var(--muted);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1;
  cursor: default;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.win-btn:hover {
  background: #2a2a2a;
  color: #f0f0f0;
}

.win-btn:nth-child(2) {
  font-size: 0.9rem;
}

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

.terminal {
  position: relative;
  height: calc(100% - 34px - 28px);
  padding: 1rem 1.1rem 0.9rem;
  overflow: hidden;
}

.terminal::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.04) 0,
    rgba(255, 255, 255, 0.04) 1px,
    transparent 2px,
    transparent 4px
  );
  opacity: 0.08;
}

.terminal::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.02);
  animation: crt-flicker 3.2s steps(1, end) infinite;
}

.history {
  max-height: 140px;
  overflow: auto;
  margin-bottom: 0.45rem;
}

.history::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.line {
  margin: 0;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--accent);
  white-space: nowrap;
  text-shadow: 0 0 8px var(--accent-soft);
}

.hidden {
  visibility: hidden;
}

.path,
.label {
  color: var(--muted);
  text-shadow: none;
}

.output {
  color: var(--accent);
}

.output.info {
  color: #d2d2d2;
}

.input-line {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
}

.input-wrap {
  position: relative;
  display: inline-block;
  min-width: 1ch;
}

.terminal-input {
  min-width: 1ch;
  width: 1ch;
  max-width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  line-height: inherit;
  outline: none;
  caret-color: transparent;
  display: block;
  text-shadow: 0 0 8px var(--accent-soft);
}

.terminal-input::selection {
  background: var(--selection-bg);
  color: var(--selection-text);
}

.caret-measure {
  position: absolute;
  visibility: hidden;
  white-space: pre;
  pointer-events: none;
  font: inherit;
  letter-spacing: inherit;
}

.cursor {
  position: absolute;
  left: 0;
  top: 0;
  display: inline-block;
  width: 0.55em;
  height: 1em;
  transform: translateY(0.2em);
  background: var(--accent);
  animation: blink 1s steps(1, end) infinite;
  pointer-events: none;
}

.clock {
  margin-left: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: var(--accent);
}

.clock.pulse {
  animation: tick-pulse 120ms ease-out;
}

.app.today .clock {
  color: var(--today-accent);
  letter-spacing: 0.08em;
}

.statusbar {
  height: 28px;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0 0.7rem;
  border-top: 1px solid var(--border);
  background: #0f0f0f;
  color: var(--muted);
  font-size: 0.72rem;
}

.status-item {
  letter-spacing: 0.04em;
}

.status-theme {
  margin-left: auto;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.72rem;
  padding: 0.18rem 0.45rem;
}

.status-theme:hover {
  color: #f0f0f0;
  border-color: #4a4a4a;
}

@keyframes tick-pulse {
  0% {
    text-shadow: 0 0 8px var(--accent-soft);
  }

  45% {
    text-shadow: 0 0 14px var(--accent);
  }

  100% {
    text-shadow: 0 0 8px var(--accent-soft);
  }
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

@keyframes crt-flicker {
  0%,
  100% {
    opacity: 0.02;
  }

  7% {
    opacity: 0.03;
  }

  9% {
    opacity: 0.01;
  }

  58% {
    opacity: 0.03;
  }

  61% {
    opacity: 0.015;
  }

  83% {
    opacity: 0.025;
  }
}
