:root {
  --bg: #0B0E13;
  --text: #C8CDD4;
  --muted: #7F8A99;
  --line: #1C232E;
  --accent: #E8C468;
}

* { box-sizing: border-box; }

html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }

body {
  display: flex;
  flex-direction: column;
  font-family: 'IBM Plex Mono', ui-monospace, Menlo, Consolas, monospace;
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.bar a { color: var(--muted); text-decoration: none; }
.bar a:hover, .bar a:focus-visible { color: var(--text); }
.bar .title { font-weight: 600; letter-spacing: 0.04em; }
.bar .muted { color: var(--muted); font-weight: 400; }

.stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px;
  min-height: 0;
}

.terminal {
  /* --cell-w and --font are set from JS so 80x24 fits the window */
  font-size: var(--font, 18px);
  line-height: 1.25;
  white-space: pre;
  outline: none;
  cursor: default;
  user-select: none;
}
.terminal:focus-visible { box-shadow: 0 0 0 2px #2A3446; border-radius: 4px; }
.terminal .row { height: 1.25em; }
.terminal .cur { background: #C8CDD4; color: var(--bg); animation: blink 1s steps(1) infinite; }
.terminal .hero { color: #FFFFFF; font-weight: 600; text-shadow: 0 0 0.45em rgba(255, 220, 160, 0.75); }

@keyframes blink { 50% { background: transparent; color: inherit; } }
@media (prefers-reduced-motion: reduce) { .terminal .cur { animation: none; } }

.status { margin: 0; font-size: 14px; color: var(--muted); min-height: 1.4em; text-align: center; }

.ended {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(5, 7, 12, 0.72);
}
.ended[hidden] { display: none; }
.ended-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 28px 36px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #121823;
}
.ended-card p { margin: 0; font-size: 18px; }
.ended-card button {
  min-height: 44px;
  padding: 0 22px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #141413;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
