/* towpath docs: themed with the game's own UI art and palette.
   Tokens mirror src/screens/theme.ts; the 9-slice border-image params
   mirror src/screens/ui.tsx exactly. */

@import url("https://fonts.googleapis.com/css2?family=Baloo+2:wght@600;700;800&family=Nunito:wght@600;700;800&display=swap");

:root {
  --ink: #22392e;
  --ink-soft: rgba(34, 57, 46, 0.72);
  --cream: #efe6cf;
  --green: #2e5339;
  --brass: #c9a227;
  --red: #a33b2e;
  --shadow: rgba(34, 57, 46, 0.3);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: "Nunito", ui-rounded, system-ui, -apple-system, sans-serif;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.65;
}

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

header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 22px;
  max-width: 960px;
  margin: 0 auto;
  padding: 26px 24px 4px;
}

.wordmark {
  font-family: "Baloo 2", sans-serif;
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--green);
  text-decoration: none;
  line-height: 1;
}

.wordmark small {
  display: block;
  font-family: "Nunito", sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--ink-soft);
}

nav {
  display: flex;
  gap: 10px;
  margin-left: auto;
}

nav a {
  border: 8px solid transparent;
  border-image: url("assets/ui-button.png") 88 fill / 16px stretch;
  padding: 4px 16px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
  font-size: 15.5px;
}

nav a[aria-current="page"] {
  color: var(--red);
}

nav a:hover {
  filter: brightness(1.05);
}

/* ---------- layout ---------- */

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 12px 24px 64px;
}

/* ---------- game panels ---------- */

.panel {
  position: relative;
  border: 34px solid transparent;
  border-image: url("assets/ui-panel3.png") 300 fill / 68px stretch;
  margin: 34px 0;
  padding: 6px 14px 14px;
}

.panel > :last-child {
  margin-bottom: 0;
}

/* Rose-and-vine flourish over two opposite corners, matching the game's
   VineCorners math: the layout border here is 34px (painted 68px), and the
   art's rose center sits ~16px into the image at this size, so -25px lands
   it on the frame's painted medallion (~25px in from the outer corner). */
.corner {
  position: absolute;
  width: 108px;
  height: 108px;
  pointer-events: none;
}

.corner.tl { top: -25px; left: -25px; }
.corner.br { bottom: -25px; right: -25px; transform: rotate(180deg); }

h1 {
  font-family: "Baloo 2", sans-serif;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--green);
  margin: 18px 0 6px;
}

h2.nameplate {
  display: inline-block;
  border: 10px solid transparent;
  border-image: url("assets/ui-nameplate.png") 170 340 fill / 18px 36px stretch;
  padding: 2px 26px;
  color: var(--cream);
  font-family: "Baloo 2", sans-serif;
  font-size: 20px;
  font-weight: 700;
  margin: 26px 0 10px;
}

h3 {
  font-family: "Baloo 2", sans-serif;
  font-size: 19px;
  color: var(--green);
  margin: 22px 0 6px;
}

p {
  margin: 10px 0;
}

main a {
  color: var(--green);
  font-weight: 800;
  text-decoration-color: var(--brass);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

main a:hover {
  color: var(--red);
}

.hint {
  font-size: 15.5px;
  color: var(--ink-soft);
}

hr.divider {
  border: 0;
  border-top: 12px solid transparent;
  border-image: url("assets/ui-divider.png") 0 140 fill / 0 18px stretch;
  height: 0;
  margin: 26px 0;
}

/* ---------- imagery ---------- */

.shot {
  width: 100%;
  border-radius: 14px;
  border: 3px solid rgba(34, 57, 46, 0.25);
  box-shadow: 0 10px 26px var(--shadow);
  display: block;
}

figure {
  margin: 22px 0;
}

figcaption {
  font-size: 15px;
  color: var(--ink-soft);
  text-align: center;
  margin-top: 8px;
}

.cast {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  justify-content: center;
  margin: 22px 0;
}

.cast figure {
  margin: 0;
  text-align: center;
  width: 132px;
}

.porthole {
  width: 108px;
  height: 108px;
  border-radius: 50%;
  border: 5px solid var(--brass);
  box-shadow: 0 4px 12px var(--shadow), inset 0 0 0 3px rgba(34, 57, 46, 0.35);
  background: #b9d4c6;
}

.cast figcaption b {
  display: block;
  font-family: "Baloo 2", sans-serif;
  font-size: 17px;
  color: var(--green);
}

/* ---------- guide furniture ---------- */

ul, ol {
  padding-left: 26px;
}

li {
  margin: 6px 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15.5px;
  margin: 14px 0;
}

th, td {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 2px solid rgba(34, 57, 46, 0.14);
  vertical-align: top;
}

th {
  font-family: "Baloo 2", sans-serif;
  color: var(--green);
  font-size: 16px;
}

code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 14.5px;
  background: rgba(34, 57, 46, 0.09);
  border-radius: 6px;
  padding: 1.5px 7px;
}

pre {
  background: rgba(34, 57, 46, 0.09);
  border-radius: 12px;
  padding: 14px 18px;
  overflow-x: auto;
}

pre code {
  background: none;
  padding: 0;
}

details {
  margin: 12px 0;
  border-radius: 12px;
  background: rgba(34, 57, 46, 0.06);
  padding: 10px 18px;
}

details[open] {
  padding-bottom: 14px;
}

summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--green);
  font-family: "Baloo 2", sans-serif;
  font-size: 17px;
}

summary::marker {
  color: var(--brass);
}

.tip {
  display: flex;
  gap: 12px;
  align-items: baseline;
  margin: 10px 0;
}

.tip::before {
  content: "❀";
  color: var(--red);
  flex: none;
}

/* ---------- index cards ---------- */

.doors {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 26px;
}

@media (max-width: 720px) {
  .doors {
    grid-template-columns: 1fr;
  }
  .corner { display: none; }
  header { padding-top: 20px; }
  nav { margin-left: 0; }
}

.doors a.door {
  color: inherit;
  text-decoration: none;
  display: block;
}

.doors a.door:hover h2 {
  filter: brightness(1.08);
}

footer {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px 46px;
  color: var(--ink-soft);
  font-size: 15px;
  text-align: center;
}
