:root { --bg: #050a05; --fg: #6dff8a; --dim: #2f7a40; --hi: #d8ffe0; --err: #ff6b6b; }
.theme-amber { --bg: #0d0800; --fg: #ffb347; --dim: #8a5a12; --hi: #ffe2b0; --err: #ff6b6b; }
.theme-plain { --bg: #111; --fg: #e8e8e8; --dim: #888; --hi: #fff; --err: #ff7b7b; }
@media (prefers-color-scheme: light) {
  .theme-plain { --bg: #fafafa; --fg: #1b1b1b; --dim: #6a6a6a; --hi: #000; --err: #b00020; }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }   /* id rules like #term{display:flex} must not override hidden */
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg); }
html { scrollbar-color: var(--dim) var(--bg); }
#out { scrollbar-color: var(--dim) var(--bg); }
body { font: 15px/1.35 "DejaVu Sans Mono", "Menlo", "Consolas", monospace; }
#frame { max-width: 84ch; margin: 0 auto; padding: 8px 16px; height: 100%; display: flex; flex-direction: column; }
#bar { border-bottom: 1px solid var(--dim); padding: 4px 0; white-space: pre; overflow: hidden; color: var(--hi); }
#login { padding: 12px 0; flex: 1; min-height: 0; overflow-y: auto; }
/* Landing hero: the logo art and the three entry buttons in one neon-framed card, in the logo's own colours
   (cyan frame, orange, violet) whatever the terminal theme (operator 2026-11-27: "buttons are integrated"). */
#hero { max-width: 680px; margin: 0 0 10px; border: 2px solid #22d3ee; border-radius: 12px; overflow: hidden;
  background: #05070f; box-shadow: 0 0 14px rgba(34, 211, 238, 0.55), inset 0 0 10px rgba(34, 211, 238, 0.25); }
#brand { margin: 0; font-size: 1em; line-height: 0; }
#brand img { display: block; width: 100%; height: auto; }
#hero #landnav { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; margin: 0; padding: 14px 12px 16px;
  border-top: 2px solid #22d3ee; background: linear-gradient(180deg, #0b1230 0%, #05070f 100%);
  box-shadow: inset 0 8px 14px -10px rgba(34, 211, 238, 0.6); }
#hero .neon { --c: #22d3ee; flex: 1 1 0; min-width: 120px; max-width: 200px; text-align: center; padding: 10px 14px;
  font: bold 15px/1.2 "DejaVu Sans Mono", "Menlo", "Consolas", monospace; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--c); text-decoration: none; border: 2px solid var(--c); border-radius: 8px; background: rgba(0, 0, 0, 0.35);
  text-shadow: 0 0 6px var(--c); box-shadow: 0 0 10px var(--c), inset 0 0 8px rgba(255, 255, 255, 0.06);
  transition: background 0.15s, color 0.15s, transform 0.1s; }
#hero .neon.cyan { --c: #22d3ee; }
#hero .neon.orange { --c: #fb923c; }
#hero .neon.violet { --c: #a78bfa; }
#hero .neon:hover, #hero .neon:focus-visible { background: var(--c); color: #05070f; text-shadow: none; outline: none; }
#hero .neon:active { transform: translateY(1px); }
#hero .neon.on { background: var(--c); color: #05070f; text-shadow: none; }
@media (max-width: 520px) { #hero #landnav { gap: 8px; } #hero .neon { min-width: 0; padding: 9px 8px; font-size: 13px; } }
@media (max-width: 420px) { #hero .neon { padding: 9px 4px; font-size: 12px; letter-spacing: 0.03em; } }   /* INSTRUCTIONS fits at 390 px */
/* landing intro under the logo card, same width, centred (operator 2026-11-28: "formated and cleaned up") */
#intro { max-width: 680px; margin: 4px 0 16px; text-align: center; }
#tagline { color: var(--hi); font-size: 1.1em; letter-spacing: 0.02em; margin: 0 0 6px; }
#about { color: var(--fg); max-width: 62ch; margin: 0 auto 8px; line-height: 1.45; }   /* SEO intro */
#facts { list-style: none; margin: 0; padding: 0; color: var(--fg); line-height: 1.5; }   /* was --dim: too dark (operator) */
#login form label { display: block; margin: 8px 0; color: var(--dim); }
#login form input, #login form select, #theme {
  display: block; width: 100%; max-width: 32ch; margin-top: 2px; padding: 6px;
  background: transparent; color: var(--fg); border: 1px solid var(--dim); font: inherit; }
.hint { color: var(--dim); }
.fieldhint { display: block; margin-top: 3px; font-size: 0.85em; color: var(--dim); }   /* under a field (2026-11-28) */
.buttons { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
button { background: transparent; color: var(--fg); border: 1px solid var(--fg); padding: 6px 12px; font: inherit; cursor: pointer; }
button:hover, button:focus-visible { background: var(--fg); color: var(--bg); outline: none; }
#loginmsg { color: var(--err); min-height: 1.4em; }
#term { flex: 1; display: flex; flex-direction: column; min-height: 0; }
#out { flex: 1; overflow-y: auto; overflow-x: auto; white-space: pre; padding: 6px 0; min-height: 0; }
#out .echo { color: var(--hi); }
#out .err { color: var(--err); }
#cmdform { display: flex; gap: 8px; border-top: 1px solid var(--dim); padding: 6px 0; }
#prompt { color: var(--hi); }
#cmd { flex: 1; background: transparent; color: var(--fg); border: none; font: inherit; outline: none; caret-color: var(--hi); }
#foot { display: flex; justify-content: space-between; align-items: end; gap: 12px; padding: 6px 0; color: var(--dim); font-size: 13px; }
@media (max-width: 640px) { body { font-size: 12px; } }
#history { flex: 1; overflow: auto; padding: 8px 0; }
#rounds { border-collapse: collapse; width: 100%; }
#rounds th, #rounds td { text-align: left; padding: 3px 10px 3px 0; border-bottom: 1px solid var(--dim); white-space: nowrap; }
#rounds th { color: var(--hi); font-weight: normal; }
#histmsg { color: var(--dim); }
#foot a { color: var(--fg); }
#foot .footlinks { display: flex; gap: 16px; flex-wrap: wrap; }   /* past rounds + Facebook (operator 2026-11-28) */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.panel { border-top: 1px solid var(--dim); padding-top: 8px; }
.panel .hint { max-width: 60ch; }
#p-newpilot summary { cursor: pointer; color: var(--dim); margin-top: 14px; }
/* Ship bio beside the hull picker (operator 2026-11-28). The bio spans both rows on the right; the second row is 1fr so
   a tall bio adds space under the left column instead of a gap between the dropdown and the fields below it. */
.hullpick { display: grid; grid-template-columns: minmax(0, 32ch) minmax(0, 1fr); grid-template-rows: auto 1fr;
  grid-template-areas: "sel bio" "rest bio"; column-gap: 24px; align-items: start; }
.hullpick > .hullsel { grid-area: sel; }
.hullpick > .shipbio { grid-area: bio; }
.hullpick > .hullrest { grid-area: rest; }
.shipbio { margin: 8px 0; padding: 10px 14px; max-width: 52ch; border: 1px solid var(--dim); border-radius: 6px;
  background: rgba(0, 0, 0, 0.25); }
.shipbio:empty { display: none; }
.shipbio .shipart { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; margin-bottom: 8px; border-radius: 4px; }
.shipbio h3 { margin: 0; color: var(--hi); font-size: 1em; font-weight: normal; text-transform: uppercase; letter-spacing: 0.08em; }
.shipbio .shiprole { margin: 0 0 6px; color: var(--dim); }
.shipbio .shiptext { margin: 0 0 8px; }
.shipbio dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; margin: 0; font-size: 0.9em; }
.shipbio dt { color: var(--dim); }
.shipbio dd { margin: 0; }
@media (max-width: 700px) {
  .hullpick { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; grid-template-areas: "sel" "bio" "rest"; }
}
button:disabled { opacity: 0.45; cursor: default; }
button:disabled:hover { background: transparent; color: var(--fg); }
#howto { max-width: 76ch; }
#howto h2 { color: var(--hi); font-size: 1em; font-weight: normal; margin: 18px 0 4px; text-transform: uppercase; letter-spacing: 0.08em; }
#howto p { margin: 4px 0 8px; }
#howto b { color: var(--hi); font-weight: normal; }
#howto pre { margin: 6px 0 10px; padding: 6px 10px; border-left: 1px solid var(--dim); overflow-x: auto; }
