:root {
  color-scheme: dark;
  --bg: #0b0f14;
  --panel: #0f1520;
  --text: #e6edf3;
  --muted: #9fb0c3;
  --accent: #7ee787;
  --error: #ff7b72;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: clamp(14px, 2.2vw, 16px);
}

.terminal {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: clamp(16px, 3vw, 32px);
  background: radial-gradient(circle at top, #111827 0%, #0b0f14 60%);
}

.terminal__output {
  flex: 1;
  overflow-y: auto;
  white-space: pre-wrap;
  line-height: 1.5;
  scrollbar-width: thin;
  scrollbar-color: #2c3645 transparent;
}

#output-lines {
  margin: 0;
}

.terminal__output::-webkit-scrollbar {
  width: 8px;
}

.terminal__output::-webkit-scrollbar-thumb {
  background: #2c3645;
  border-radius: 999px;
}

.terminal__input {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.terminal__prompt {
  color: var(--accent);
}

.terminal__prompt-output {
  color: var(--muted);
}

.terminal__hidden-input {
  position: fixed;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: 0;
  border: 0;
  opacity: 0;
  background: transparent;
  color: transparent;
  pointer-events: none;
  transform: scale(0);
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  overflow: hidden;
}

.terminal__input-text {
  min-height: 1em;
  word-break: break-word;
}

.terminal__cursor {
  width: 8px;
  height: 1.1em;
  background: var(--text);
  display: inline-block;
  animation: blink 1s step-end infinite;
}

.terminal--locked .terminal__cursor {
  display: none;
}

.terminal--locked .terminal__input-text,
.terminal--locked .terminal__prompt {
  color: var(--muted);
}

.terminal__muted {
  color: var(--muted);
}

.terminal__line--accent {
  color: var(--accent);
}

.terminal__line--muted {
  color: var(--muted);
}

.terminal__line--info {
  color: #79c0ff;
}

.terminal__line--link {
  color: #a5d6ff;
}

.terminal__link {
  color: #a5d6ff;
  text-decoration: none;
  border-bottom: 1px dashed rgba(165, 214, 255, 0.5);
}

.terminal__link:hover {
  color: #d7e9ff;
  border-bottom-color: rgba(215, 233, 255, 0.8);
}

.terminal__command-chip {
  background: none;
  border: none;
  color: var(--accent);
  font: inherit;
  padding: 0;
  cursor: pointer;
  border-bottom: 1px dotted rgba(126, 231, 135, 0.6);
}

.terminal__command-chip:hover {
  color: #b7f7c1;
  border-bottom-color: rgba(183, 247, 193, 0.8);
}

.terminal__game {
  padding: 12px;
  background: rgba(15, 21, 32, 0.92);
  border: none;
  border-radius: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  box-shadow: none;
}

.terminal__game canvas {
  display: block;
  background: rgba(6, 10, 16, 0.9);
  border-radius: 6px;
  width: 100%;
  height: 100%;
  flex: 1;
}

.terminal__game-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 10, 16, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 0;
  cursor: none;
}

.terminal__game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.8em;
}

.terminal__game-exit {
  background: transparent;
  border: 1px solid rgba(126, 231, 135, 0.4);
  color: var(--accent);
  font: inherit;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
}

.terminal__game-exit:hover {
  background: rgba(126, 231, 135, 0.12);
}

.terminal__error {
  color: var(--error);
}

.terminal__separator {
  height: 1px;
  background: #1f2a3a;
  margin: 8px 0;
}

.terminal__row {
  display: grid;
  grid-template-columns: minmax(90px, 1.1fr) minmax(180px, 2.4fr) minmax(180px, 2.2fr);
  column-gap: 16px;
  align-items: start;
  padding: 2px 0;
}

.terminal__row:hover {
  background: rgba(255, 255, 255, 0.07);
}

.terminal__row--header {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.85em;
}

.terminal__col {
  min-width: 0;
  word-break: break-word;
}

.terminal__col--year {
  color: var(--muted);
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

@media (max-width: 600px) {
  .terminal {
    padding: 16px;
  }

  .terminal__row {
    grid-template-columns: 1fr;
    row-gap: 4px;
  }
}
