/* Realmstate shell: the sign-in gate and the message line, around the War Room.
   Colours and type come from tokens the War Room defines on :root[data-view="room"]:
   --bg --panel --field --ink --muted --line --accent --on-accent --bad --good --focus --font --radius.
   The War Room's own styles live in views/room/room.css. */

:root {
  /* Neutral fallbacks; each view overrides these. */
  --bg: #eef0f2; --panel: #ffffff; --field: #ffffff; --ink: #1d2229; --muted: #5c6670; --line: #c9cfd6;
  --accent: #3b5b7a; --on-accent: #ffffff; --bad: #a23a2a; --good: #2f6b3f; --focus: #3b5b7a;
  --font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; --radius: 8px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111418; --panel: #1a1f25; --field: #0f1317; --ink: #e3e7eb; --muted: #97a1ab; --line: #2e363f;
    --accent: #8fb3d6; --on-accent: #0d1115; --bad: #e58a72; --good: #8fc5a1; --focus: #8fb3d6;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: var(--font); -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.noscript { padding: 16px; }

.skip { position: absolute; left: -999px; top: 4px; z-index: 100; background: var(--accent); color: var(--on-accent); padding: 4px 10px; }
.skip:focus { left: 8px; }

/* ---------- the message line (role=status); each view places it ---------- */
.status { margin: 0; overflow-wrap: anywhere; }
.status.bad { color: var(--bad); }

/* ---------- the view switch ---------- */

/* ---------- can't reach the game: a card, a quiet pulse, the next try counting down ---------- */
.gate.offline { text-align: center; }
.gate.offline .gate-head { justify-content: center; }
.gate.offline h1 .pre { display: block; font-size: 0.62em; font-weight: 400; letter-spacing: 0.04em; text-transform: none; color: var(--muted); }
.gate.offline h2 { margin: 0.4rem 0 0.5rem; font-size: 1.15rem; }
.gate.offline .lede { margin-bottom: 0.7rem; }
.gate.offline .row.end { justify-content: center; }
.off-mark { display: flex; justify-content: center; gap: 7px; margin: 0.9rem 0 0.3rem; }
.off-mark i { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); opacity: 0.25; animation: off-pulse 1.4s infinite ease-in-out; }
.off-mark i:nth-child(2) { animation-delay: 0.2s; }
.off-mark i:nth-child(3) { animation-delay: 0.4s; }
@keyframes off-pulse { 0%, 80%, 100% { opacity: 0.25; transform: scale(0.85); } 40% { opacity: 1; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .off-mark i { animation: none; opacity: 0.6; } }
.off-next { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.off-detail { margin: 0.9rem 0 0; font-size: 0.8rem; color: var(--muted); overflow-wrap: anywhere; }

/* ---------- the gate: sign in, found a house ---------- */
.gate {
  width: min(27rem, calc(100% - 32px)); margin: 10vh auto 24px; padding: 1.2rem 1.3rem 1.1rem;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
}
.gate-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 0.6rem; }
.gate h1 { margin: 0; font-size: 1.4rem; letter-spacing: 0.12em; color: var(--accent); font-weight: 700; text-transform: uppercase; }
.gate .lede { margin: 0 0 0.9rem; color: var(--muted); }
.gate form { display: flex; flex-direction: column; gap: 0.35rem; }
.gate label, .gate legend { font-size: 0.85rem; color: var(--muted); font-weight: 600; }
.gate input, .gate select, .gate button {
  font: inherit; color: inherit; min-height: 2.3rem; min-width: 0;
  background: var(--field); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.3rem 0.55rem;
}
.gate input, .gate select { width: 100%; }
.gate button { cursor: pointer; padding: 0.3rem 0.9rem; }
.gate button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.gate button.ghost { background: transparent; }
.gate button:disabled { opacity: 0.55; cursor: progress; }
.gate .row { display: flex; gap: 0.45rem; align-items: center; }
.gate .row input { flex: 1; }
.gate .row.end { justify-content: flex-end; margin-top: 0.7rem; }
.gate .hint { color: var(--muted); font-size: 0.85rem; margin: 0.3rem 0 0; }
.gate .grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0.6rem; margin-top: 0.4rem; }
.gate .grid2 > div { display: flex; flex-direction: column; gap: 0.35rem; }
.gate .where { border: 0; padding: 0; margin: 0.5rem 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.gate .where legend { padding: 0; margin-bottom: 0.35rem; }
.gate .where input { width: 5.5rem; text-align: right; }
.gate .where .hint { flex-basis: 100%; }
@media (max-width: 400px) { .gate .grid2 { grid-template-columns: minmax(0, 1fr); } }

/* The view switch (War room / Map), shown by both views. */
.vswitch { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.vswitch-l { font-size: .8em; opacity: .8; }
.vswitch select { font: inherit; color: inherit; background: var(--field); border: 1px solid var(--line); border-radius: var(--radius); padding: 2px 6px; min-height: 1.9rem; }
.vswitch kbd {
  font: 0.72rem/1 ui-monospace, Menlo, Consolas, monospace; color: var(--muted);
  border: 1px solid var(--line); border-radius: 4px; padding: 2px 4px;
}
@media (hover: none) { .vswitch kbd { display: none; } }
