/* Tacitus Custos Games — shared styles */

:root {
  --ink: #16213e;
  --paper: #fffdfa;
  --rule: #c9cdda;
  --muted: #5c6480;
  --accent: #b3322e;
  --soft: #eef0f5;
  --flagbg: #fbe9e7;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --mono: ui-monospace, Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
}

a { color: var(--ink); }
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- header / footer ---------- */

.site-head {
  max-width: 640px;
  margin: 0 auto;
  padding: 18px 14px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  align-items: baseline;
  justify-content: space-between;
}
.site-head .home {
  font-style: italic;
  font-size: 18px;
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
}
.site-head nav {
  display: flex;
  gap: 14px;
  font-size: 14px;
}
.site-head nav a { color: var(--muted); text-decoration: none; border-bottom: 1px solid transparent; }
.site-head nav a:hover { border-bottom-color: var(--rule); }
.site-head nav a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }

.site-foot {
  max-width: 640px;
  margin: 0 auto;
  padding: 36px 14px 40px;
  font-size: 12.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  border-top: 1px solid var(--rule);
  margin-top: 40px;
}

/* ---------- landing ---------- */

.landing {
  max-width: 640px;
  margin: 0 auto;
  padding: 64px 14px 0;
  text-align: center;
}
.mark { color: var(--accent); }
.mark svg { width: 62px; height: 62px; display: block; margin: 0 auto; }

.wordmark {
  font-size: 44px;
  font-style: italic;
  font-weight: 400;
  line-height: 1.02;
  margin: 18px 0 0;
}
.wordmark-sub {
  display: block;
  font-style: normal;
  font-size: 15px;
  letter-spacing: 0.42em;
  text-indent: 0.42em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 10px;
}

.tagline {
  font-size: 19px;
  color: var(--ink);
  margin: 22px auto 0;
  max-width: 30ch;
}

.doors {
  display: grid;
  gap: 12px;
  margin: 40px auto 0;
  max-width: 420px;
  text-align: left;
}
.door {
  display: block;
  padding: 16px 18px;
  border: 1px solid var(--rule);
  border-radius: 5px;
  text-decoration: none;
  background: #fff;
}
.door:hover { border-color: var(--ink); }
.door-name { display: block; font-size: 21px; font-style: italic; }
.door-note { display: block; font-size: 13.5px; color: var(--muted); margin-top: 3px; }

/* ---------- tollbooth stub ---------- */

.stub {
  max-width: 640px;
  margin: 0 auto;
  padding: 72px 14px 0;
  text-align: center;
}
.barrier {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-bottom: 30px;
}
.barrier span {
  width: 34px;
  height: 11px;
  border: 1px solid var(--ink);
  border-radius: 2px;
}
.barrier span:nth-child(odd) { background: var(--accent); border-color: var(--accent); }

.stub h1 {
  font-size: 38px;
  font-style: italic;
  font-weight: 400;
  margin: 0;
}
.stub-line { font-size: 19px; margin: 18px 0 0; }
.stub-price {
  color: var(--accent);
  font-style: italic;
}
.stub-back { margin-top: 40px; font-size: 14px; }
.stub-back a { color: var(--muted); }

/* ---------- arcade shell ---------- */

.arcade {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px 14px 0;
}
.arcade > h1 {
  font-size: 40px;
  font-style: italic;
  font-weight: 400;
  margin: 12px 0 0;
  line-height: 1.05;
}
.arcade .lede { color: var(--muted); font-size: 14px; margin: 8px 0 0; }
.cabinet {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1.5px solid var(--accent);
}
.coming {
  margin-top: 34px;
  font-size: 13.5px;
  color: var(--muted);
  border-top: 1px solid var(--rule);
  padding-top: 14px;
}

/* ---------- Patrol ---------- */

.pt { line-height: 1.5; }
.pt h2,
.cf h2 {
  font-size: 32px;
  font-style: italic;
  font-weight: 400;
  margin: 0;
  line-height: 1.05;
}
.pt h3,
.cf h3 {
  font-size: 20px;
  font-weight: 600;
  margin: 30px 0 8px;
  padding-bottom: 3px;
  border-bottom: 1.5px solid var(--accent);
}
.pt p,
.cf p { margin: 0 0 10px; }
.pt .note,
.cf .note { font-size: 13.5px; color: var(--muted); }
.pt .ctl,
.cf .ctl { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pt input[type="text"],
.cf input[type="text"] {
  font: inherit;
  padding: 6px 8px;
  border: 1px solid #9aa0b8;
  border-radius: 4px;
  flex: 1;
  min-width: 110px;
  color: inherit;
  background: #fff;
}
.pt button,
.cf button {
  font: inherit;
  padding: 6px 12px;
  border: 1px solid var(--ink);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}
.pt button.on,
.cf button.on { background: var(--ink); color: #fff; }
.pt button:disabled,
.cf button:disabled { opacity: 0.45; cursor: default; }

.pt .grid {
  display: grid;
  gap: 2px;
  margin: 14px auto 8px;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}
.pt .cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--rule);
  border-radius: 3px;
  font-size: 14px;
  background: #fff;
  color: var(--ink);
  padding: 0;
  cursor: pointer;
}
.pt .cell.unk { background: var(--soft); color: #9aa0b8; }
.pt .cell.vis { background: #fff; }
.pt .cell.me { background: var(--ink); color: #fff; font-weight: 600; }
.pt .cell.adj { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.pt .cell.flag { background: var(--flagbg); color: var(--accent); font-weight: 600; }
.pt .cell.guard { background: var(--accent); color: #fff; }
.pt .cell.goal { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.pt .cell.path { background: #e4e8f3; }

.pt .status { font-size: 20px; font-style: italic; margin: 6px 0; }
.pt textarea {
  width: 100%;
  height: 230px;
  font: 12px/1.35 var(--mono);
  padding: 8px;
  border: 1px solid #9aa0b8;
  border-radius: 4px;
  color: inherit;
  background: #fff;
  resize: vertical;
  white-space: pre;
}

/* ---------- Language Forge ---------- */

.cf { line-height: 1.5; }
.cf .L { font-style: italic; }
.cf .ipa { color: var(--muted); font-style: normal; font-size: 14px; }
.cf .g {
  font-variant: small-caps;
  color: var(--accent);
  letter-spacing: 0.03em;
}

.cf-head { margin-top: 18px; }
.cf .langname {
  font-size: 40px;
  font-style: italic;
  font-weight: 400;
  line-height: 1.05;
  overflow-wrap: anywhere;
}
.cf .spec {
  font-size: 22px;
  font-style: italic;
  margin: 20px 0 2px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.cf .tr { margin-top: 4px; color: #3a4160; }

/* interlinear gloss: each word is a surface form stacked over its gloss */
.cf .sent { margin: 0 0 16px; }
.cf .il {
  display: flex;
  flex-wrap: wrap;
  gap: 0 14px;
  row-gap: 4px;
}
.cf .il > span { display: inline-flex; flex-direction: column; }
.cf .il .top { font-style: italic; font-size: 18px; }
.cf .il .bot { font-size: 13px; color: var(--muted); line-height: 1.25; }

.cf table { border-collapse: collapse; font-size: 15px; }
.cf td { padding: 2px 12px 2px 0; vertical-align: top; }
.cf .num {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 12px;
  font-size: 15px;
}
.cf .dict {
  columns: 2;
  column-gap: 20px;
  font-size: 14.5px;
}
.cf .dict div { break-inside: avoid; margin-bottom: 3px; }
.cf textarea {
  width: 100%;
  height: 260px;
  font: 13px/1.4 var(--mono);
  padding: 8px;
  border: 1px solid #9aa0b8;
  border-radius: 4px;
  color: inherit;
  background: #fff;
  resize: vertical;
}

@media (max-width: 480px) {
  .cf .dict { columns: 1; }
  .cf .langname { font-size: 32px; }
}

/* ---------- Language Forge: puzzle / answer split ---------- */

.cf .subhead {
  font-weight: 600;
  margin: 20px 0 6px;
}
.cf .corpus { margin: 10px 0 14px; }
.cf .cline {
  display: flex;
  gap: 10px;
  align-items: baseline;
  font-style: italic;
  font-size: 17px;
  line-height: 1.45;
  padding: 1px 0;
}
.cf .cline .n {
  color: var(--muted);
  font-style: normal;
  font-size: 13px;
  min-width: 22px;
  text-align: right;
  flex: none;
}
.cf .cline.eng { font-style: normal; font-size: 15px; color: #3a4160; }

.cf .cf-answerbox {
  width: 100%;
  height: 110px;
  font: inherit;
  font-size: 15px;
  padding: 8px;
  border: 1px solid #9aa0b8;
  border-radius: 4px;
  color: inherit;
  background: #fff;
  resize: vertical;
}
.cf .verdict {
  font-size: 20px;
  font-style: italic;
  margin: 14px 0 4px;
}
.cf .verdict.right { color: #2f6b45; }
.cf .verdict.wrong { color: var(--accent); }
.cf .verdict.open { color: var(--ink); }
.cf .compare {
  margin: 10px 0 4px;
  padding: 10px 12px;
  background: var(--soft);
  border-radius: 4px;
  font-size: 15px;
}
.cf .compare > div { display: flex; gap: 10px; padding: 2px 0; }
.cf .clabel {
  color: var(--muted);
  font-size: 12.5px;
  min-width: 64px;
  flex: none;
  padding-top: 2px;
}
.cf .compare .given { overflow-wrap: anywhere; }

/* the key stays out of the flow until it is asked for */
.cf #cf-key[hidden] { display: none; }
.cf #cf-key {
  margin-top: 26px;
  padding-top: 4px;
  border-top: 1px dashed var(--rule);
}

/* ---------- the block addressed to models ---------- */

.agents {
  margin-top: 26px;
  padding: 16px 18px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--soft);
  font-size: 14.5px;
}
.agents h2 {
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 8px;
  font-style: italic;
}
.agents p { margin: 0 0 8px; }
.agents p:last-child { margin-bottom: 0; }
.agents strong { font-weight: 600; }
.agents em { font-style: italic; }
.agents pre {
  font: 12.5px/1.5 var(--mono);
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 8px 10px;
  margin: 0 0 8px;
  overflow-x: auto;
  white-space: pre;
}
