/* ================================================================
   DOS / old-school terminal aesthetic
   black background, white monospace, subtle scanlines + blinking cursor
   ================================================================ */

:root {
  --fg: #e6e6e6;
  --fg-dim: #8a8a8a;
  --accent: #ffffff;
  --hit: #ffd86b;        /* signal trail */
  --dest: #ff6a6a;       /* destination */
  --border: #2b2b2b;
  --bg: #000000;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Courier New", "Consolas", "VT323", ui-monospace, monospace;
  font-size: 15px;
  line-height: 1.45;
  min-height: 100vh;
  overflow-x: hidden;
}

/* subtle CRT scanlines */
#scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,0.03) 0px,
    rgba(255,255,255,0.03) 1px,
    transparent 1px,
    transparent 3px
  );
  z-index: 9999;
  mix-blend-mode: screen;
}

.bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.bar.foot {
  border-bottom: none;
  border-top: 1px solid var(--border);
  color: var(--fg-dim);
  font-size: 12px;
}

.bar-left, .bar-right { display: flex; gap: 10px; align-items: center; }

.tab {
  background: transparent;
  color: var(--fg-dim);
  border: 1px solid var(--border);
  padding: 2px 8px;
  font-family: inherit;
  cursor: pointer;
  letter-spacing: 1px;
}
.tab.active { color: var(--accent); border-color: var(--accent); }
.tab:hover { color: var(--fg); }

.blink {
  animation: blink 1s steps(2, end) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

main {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) 2fr;
  grid-template-rows: auto 1fr;
  gap: 0;
  min-height: calc(100vh - 70px);
}

#prompt {
  grid-column: 1 / 2;
  grid-row: 1 / 2;
  padding: 18px 20px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

#banner {
  font-size: 10px;
  line-height: 1.1;
  color: var(--accent);
  margin: 0 0 14px 0;
  white-space: pre;
  overflow-x: auto;
}

.sub {
  color: var(--fg-dim);
  margin: 0 0 12px 0;
}

#traceForm {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--accent);
  padding: 8px 10px;
  background: #0a0a0a;
}

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

#target {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--accent);
  font-family: inherit;
  font-size: 16px;
  caret-color: var(--accent);
}

#go {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: inherit;
  padding: 4px 10px;
  cursor: pointer;
  letter-spacing: 1px;
}
#go:hover { background: var(--accent); color: var(--bg); }
#go:disabled { opacity: 0.4; cursor: not-allowed; }

.status {
  margin-top: 12px;
  color: var(--fg-dim);
  white-space: pre-wrap;
  word-break: break-all;
}

#stage {
  grid-column: 2 / 3;
  grid-row: 1 / 3;
  position: relative;
  border-bottom: 1px solid var(--border);
  min-height: 500px;
  background: #000;
}

.view {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.hidden { display: none !important; }

#globe2d svg { display: block; width: 100%; height: 100%; }

#panel {
  grid-column: 1 / 2;
  grid-row: 2 / 3;
  padding: 14px 20px;
  border-right: 1px solid var(--border);
  overflow-y: auto;
  max-height: calc(100vh - 70px - 280px);
}

#panel h2 {
  font-size: 14px;
  color: var(--fg-dim);
  margin: 0 0 10px 0;
  letter-spacing: 1px;
  text-transform: uppercase;
}

#hopList {
  list-style: none;
  padding: 0;
  margin: 0 0 12px 0;
  font-size: 13px;
}
#hopList li {
  padding: 4px 0;
  border-bottom: 1px dashed #1a1a1a;
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 8px;
  align-items: baseline;
}
#hopList li .n { color: var(--fg-dim); }
#hopList li .where { color: var(--accent); }
#hopList li .ip { color: var(--fg-dim); font-size: 11px; }
#hopList li.current { background: #141414; }
#hopList li.dest .where { color: var(--dest); }

#controls { display: flex; gap: 10px; margin-top: 10px; }
.action {
  flex: 1;
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: inherit;
  padding: 6px 10px;
  cursor: pointer;
  letter-spacing: 1px;
}
.action:hover { background: var(--accent); color: var(--bg); }

@media (max-width: 900px) {
  main { grid-template-columns: 1fr; grid-template-rows: auto 420px auto; }
  #prompt { grid-column: 1; grid-row: 1; border-right: none; }
  #stage  { grid-column: 1; grid-row: 2; }
  #panel  { grid-column: 1; grid-row: 3; max-height: none; border-right: none; }
}
