:root {
  --bg: #0b0e14;
  --panel: #11151d;
  --bar: #1a1f2b;
  --fg: #d7dce5;
  --dim: #6f7a90;
  --accent: #5ccfa0;
  --accent-2: #7aa2f7;
  --warn: #e0af68;
  --border: #232a38;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  padding: clamp(0px, 3vh, 2.5rem) clamp(0px, 3vw, 2.5rem);
  background:
    radial-gradient(1200px 600px at 15% -10%, #16202e 0%, transparent 60%),
    var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 14.5px;
  line-height: 1.6;
}

.window {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 60rem;
  margin: 0 auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 24px 70px rgb(0 0 0 / 0.45);
}

/* ---------------------------------------------------------------- titlebar */

.titlebar {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .55rem .8rem;
  background: var(--bar);
  border-bottom: 1px solid var(--border);
  font-size: .78rem;
  color: var(--dim);
}

.dot { width: 11px; height: 11px; border-radius: 50%; flex: none; }
.dot-red { background: #ff5f57; }
.dot-yellow { background: #febc2e; }
.dot-green { background: #28c840; }

.title { margin-left: .5rem; }

.escape {
  margin-left: auto;
  color: var(--accent-2);
  text-decoration: none;
  border-bottom: 1px dotted currentColor;
}
.escape:hover { color: var(--accent); }

/* ------------------------------------------------------------------ screen */

.screen {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.1rem 1.4rem;
  outline: none;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

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

.line { min-height: 1.1em; }
.dim { color: var(--dim); }
.accent { color: var(--accent); }
.accent2 { color: var(--accent-2); }
.warn { color: var(--warn); }
.bold { font-weight: 700; color: #fff; }
.rule { color: var(--border); }

#output a { color: var(--accent-2); text-decoration: none; border-bottom: 1px solid rgb(122 162 247 / .35); }
#output a:hover { color: var(--accent); }

/* --------------------------------------------------------------- inputline */

.inputline { display: flex; align-items: baseline; gap: .55rem; position: relative; }
.prompt { color: var(--accent); flex: none; }
.typed { white-space: pre-wrap; word-break: break-word; }

.caret {
  display: inline-block;
  width: .55em;
  height: 1.05em;
  vertical-align: text-bottom;
  background: var(--fg);
  animation: blink 1.1s steps(1) infinite;
}
.caret.idle { background: transparent; box-shadow: inset 0 0 0 1px var(--dim); }

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

/* The real input is invisible; the rendered .typed span is what you see. */
#input {
  position: absolute;
  inset: 0;
  width: 100%;
  opacity: 0;
  border: 0;
  padding: 0;
  font: inherit;
  color: transparent;
  background: transparent;
  caret-color: transparent;
}

/* ------------------------------------------------------------------- hints */

.hints {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  padding: .6rem .8rem;
  background: var(--bar);
  border-top: 1px solid var(--border);
}

.hints button {
  font: inherit;
  font-size: .78rem;
  color: var(--dim);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .18rem .6rem;
  cursor: pointer;
}
.hints button:hover, .hints button:focus-visible {
  color: var(--accent);
  border-color: var(--accent);
  outline: none;
}

@media (prefers-reduced-motion: reduce) {
  .caret { animation: none; }
}

@media (max-width: 600px) {
  body { padding: 0; font-size: 13.5px; }
  .window { border: 0; border-radius: 0; }
  .title { display: none; }
}
