/* Same green-phosphor palette and FreeMono as the docs
   (FreeBodyEngine/docs/stylesheets/extra.css). */

@font-face {
  font-family: "FreeMono";
  src: url("fonts/FreeMono.otf") format("opentype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "FreeMono";
  src: url("fonts/FreeMonoBold.otf") format("opentype");
  font-weight: 700;
  font-display: swap;
}

:root {
  --bg:        #060e08;
  --bg-alt:    #0c1a0f;
  --border:    #174d2c;
  --muted:     #3d8f5c;
  --fg:        #8effc8;
  --fg-bright: #d4fff0;
  --accent:    #5df0a2;
  --error:     #ff7a7a;
  --warn:      #ffd479;
  --glow: 0 0 6px rgba(93, 240, 162, 0.45);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.45 "FreeMono", ui-monospace, "Cascadia Mono", Consolas, monospace;
}

body { overflow: hidden; }

#terminal {
  height: 100%;
  overflow-y: auto;
  padding: 20px 16px 40vh;
  cursor: text;
  text-shadow: var(--glow);
}

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

.line { min-height: 1.45em; }
.muted  { color: var(--muted); }
.bright { color: var(--fg-bright); font-weight: 700; }
.accent { color: var(--accent); }
.error  { color: var(--error); text-shadow: none; }
.warn   { color: var(--warn); text-shadow: none; }
.banner { color: var(--accent); line-height: 1.1; font-size: clamp(6px, 1.9vw, 16px); }

a { color: var(--accent); }
a:hover, a:focus-visible { color: var(--fg-bright); }

button.cmd {
  all: unset;
  color: var(--accent);
  text-decoration: underline dotted;
  cursor: pointer;
}
button.cmd:hover, button.cmd:focus-visible { color: var(--fg-bright); }

#prompt-line { display: flex; gap: 0.6ch; }
#prompt { white-space: pre; flex: none; }
#input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: 0;
  padding: 0;
  color: var(--fg-bright);
  font: inherit;
  text-shadow: inherit;
  caret-color: var(--accent);
}

.user { color: var(--accent); }
.host { color: var(--fg-bright); }
.path { color: var(--muted); }

.grid { display: grid; grid-template-columns: max-content 1fr; column-gap: 2ch; }

/* `play` overlay */
#game {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  z-index: 10;
}
#game[hidden] { display: none; }
#game-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--muted);
}
#game-close {
  all: unset;
  color: var(--accent);
  cursor: pointer;
}
#game-close:hover, #game-close:focus-visible { color: var(--fg-bright); }
#game-frame { flex: 1; width: 100%; border: 0; background: #000; }

::selection { background: var(--border); color: var(--fg-bright); }

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
