/* Reinwind Directory — the same hand-drawn storybook at twilight as the Reinwind launcher.
   Original artwork; system fonts only; no external resources. */

:root {
  --night-0: #150d27;
  --night-1: #1d1433;
  --night-2: #2b1d4f;
  --night-3: #3a2560;

  --text: #fbf3ff;
  --soft: #d7c8ea;
  --lilac: #c9b6ff;
  --blush: #ffb8d9;
  --rose: #f5a3c7;
  --peach: #ffcfb0;
  --gold: #f6d98b;
  --plum: #3a1544;

  --ok: #a8f0d6;
  --warn: #ffe08a;
  --err: #ffa8bd;

  --ink: rgba(246, 217, 139, 0.55);
  --ink-faint: rgba(246, 217, 139, 0.22);
  --paper: rgba(27, 17, 48, 0.86);
  --paper-solid: #24173f;

  --display: Georgia, "Palatino Linotype", "Book Antiqua", serif;
  --body: "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --mono: "Cascadia Mono", Consolas, "Courier New", monospace;

  --ease: cubic-bezier(0.22, 0.8, 0.26, 1);
  --spring: cubic-bezier(0.34, 1.5, 0.64, 1);
  --slow: cubic-bezier(0.45, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { min-height: 100%; background: var(--night-1); color-scheme: dark; scroll-behavior: smooth; }
body {
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: linear-gradient(180deg, var(--night-0) 0%, var(--night-1) 45%, var(--night-2) 100%) fixed;
  -webkit-font-smoothing: antialiased;
}

/* Paper / ink grain over everything */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1000;
  opacity: 0.09;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 0.95  0 0 0 0 0.9  0 0 0 0.7 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

::selection { background: rgba(255, 184, 217, 0.35); color: var(--text); }

h1, h2, h3, p { margin: 0; }
a { color: var(--blush); }
code { font-family: var(--mono); font-size: 0.88em; padding: 1px 6px; border-radius: 5px; background: rgba(201, 182, 255, 0.12); color: var(--text); overflow-wrap: anywhere; }
strong { font-weight: 700; color: var(--text); }
em { font-style: italic; }
.soft { color: var(--soft); }
.center { text-align: center; justify-content: center; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
svg { flex: none; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---------- Focus: always visible, soft gold ---------- */
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 200;
  padding: 8px 18px; border-radius: 999px;
  background: var(--paper-solid); border: 1px solid var(--gold); color: var(--text);
  font-style: italic; text-decoration: none;
  transition: top 0.3s var(--ease);
}
.skip-link:focus { top: 12px; }

/* ---------- The illustrated night meadow (fixed behind every page) ---------- */
.stage { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* The sky stays almost still: a slow moon glow and two small groups of stars that fade gently. */
.scene-glow { animation: moon-breathe 16s ease-in-out infinite alternate; }
@keyframes moon-breathe { from { opacity: 0.8; } to { opacity: 1; } }
.twinkle-a { animation: twinkle 14s ease-in-out infinite alternate; }
.twinkle-b { animation: twinkle 19s ease-in-out -7s infinite alternate; }
@keyframes twinkle { from { opacity: 0.35; } to { opacity: 0.85; } }
.stars circle { fill: #fff4fa; }
.moon-body { fill: #fff3ec; stroke: rgba(246, 217, 139, 0.7); stroke-width: 1; }
.hill-far { fill: #2c1d4d; }
.hill-mid { fill: #22163e; }
.hill-near { fill: #190f2e; }
.ink { fill: none; stroke: var(--ink); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.ink.sketch { stroke-width: 0.9; opacity: 0.55; stroke-dasharray: 70 9 26 7; }
.ink.rose { stroke: rgba(255, 184, 217, 0.6); }
.tree-canopy { fill: #1d1336; stroke: rgba(255, 184, 217, 0.55); stroke-width: 1.3; }
.gate-door { stroke: rgba(246, 217, 139, 0.45); }
.lamp { fill: #ffe9c4; }
.grass { stroke: rgba(255, 184, 217, 0.4); }
.horse-body { fill: #170e2a; stroke: rgba(246, 217, 139, 0.6); stroke-width: 1.4; stroke-linejoin: round; }
.horse-mane { fill: none; stroke: rgba(255, 184, 217, 0.7); stroke-width: 1.4; stroke-linecap: round; }
.horse-bob { animation: gallop 0.42s cubic-bezier(0.3, 0, 0.4, 1) infinite; }
@keyframes gallop { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-3px); } }
.portal { opacity: 0.4; animation: portal-breathe 14s ease-in-out infinite alternate; }
@keyframes portal-breathe { from { opacity: 0.3; } to { opacity: 0.5; } }
.vignette { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 40%, transparent 50%, rgba(8, 4, 20, 0.65) 100%); }

/* ---------- Effects canvas (fireflies, sparkles) ---------- */
.fx-canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 60; }

/* ---------- Header ---------- */
.site-header, .site-main, .site-footer { position: relative; z-index: 2; }
.site-header {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px 24px;
  padding: 18px clamp(18px, 4vw, 48px) 10px;
}
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; border-radius: 10px; }
.brand-mark { width: 40px; height: 40px; }
.brand-name { font-family: var(--display); font-style: italic; font-size: 25px; letter-spacing: 0.05em; line-height: 1; }

.nav { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 18px; margin-left: auto; }
.nav-link {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 4px 8px;
  font-family: var(--display); font-style: italic; font-size: 17px;
  color: var(--soft); text-decoration: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 8' preserveAspectRatio='none'><path d='M2 5 C 20 2, 40 7, 60 4 S 88 2.5, 98 5' fill='none' stroke='%23f6d98b' stroke-width='1.4' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat; background-position: 50% 100%; background-size: 0% 7px;
  transition: background-size 0.5s var(--ease), color 0.25s;
}
.nav-link svg { width: 19px; height: 19px; }
.nav-link:hover { color: var(--text); background-size: 100% 7px; }
.nav-link[aria-current="page"] { color: var(--text); background-size: 100% 7px; }
.nav form { display: inline; margin: 0; }
.nav .btn { margin-left: 4px; }

/* ---------- Main & footer ---------- */
.site-main { flex: 1; width: 100%; padding: 24px clamp(14px, 4vw, 48px) 80px; }
.site-main > * + * { margin-top: 34px; }
.site-footer {
  padding: 30px clamp(18px, 4vw, 48px) 34px;
  text-align: center; font-size: 14.5px; color: var(--soft);
  background: linear-gradient(180deg, transparent, rgba(12, 7, 24, 0.75) 40%);
}
.site-footer p + p { margin-top: 6px; }
.site-footer .divider { margin-bottom: 14px; }

/* ---------- Pages (paper with gold ink frame) ---------- */
.page {
  position: relative;
  max-width: 640px;
  margin-left: auto; margin-right: auto;
  padding: 46px 54px 42px;
  background: var(--paper);
  border: 1px solid var(--ink-faint);
  border-radius: 4px;
  outline: 1px solid rgba(246, 217, 139, 0.12);
  outline-offset: -9px;
  box-shadow: 0 30px 60px -30px rgba(4, 2, 12, 0.9);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  animation: page-in 0.5s var(--ease) both;
}
.page.wide { max-width: 900px; }
.page.narrow { max-width: 480px; }
/* Public pages: a quiet sheet, no ink corners or double frame. */
.page.plain { outline: 0; border-radius: 16px; padding: 38px 44px 34px; background: rgba(27, 17, 48, 0.9); }
@keyframes page-in { from { opacity: 0; } to { opacity: 1; } }
.corner { position: absolute; width: 56px; height: 56px; color: rgba(246, 217, 139, 0.55); pointer-events: none; }
.corner.tl { top: 6px; left: 6px; }
.corner.tr { top: 6px; right: 6px; transform: scaleX(-1); }
.corner.bl { bottom: 6px; left: 6px; transform: scaleY(-1); }
.corner.br { bottom: 6px; right: 6px; transform: scale(-1, -1); }

.page > * + *, .section > * + * { margin-top: 16px; }
.page > .corner { margin-top: 0; }
.page-title {
  font-family: var(--display); font-style: italic; font-weight: 400;
  font-size: 34px; line-height: 1.2; letter-spacing: 0.02em; text-align: center; text-wrap: balance;
}
.section-title { font-family: var(--display); font-style: italic; font-weight: 400; font-size: 25px; line-height: 1.25; }
.section-title.center { text-align: center; }
.divider { display: block; width: 200px; height: 16px; margin-left: auto; margin-right: auto; color: var(--ink); }
.lead { font-size: 18px; line-height: 1.6; text-align: center; text-wrap: pretty; }
.lead.soft { color: var(--soft); }
.quiet-note { color: var(--soft); font-size: 16px; }
.section { margin-top: 36px !important; padding-top: 26px; border-top: 1px dashed var(--ink-faint); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- The mark (draws itself once, on the front page only) ---------- */
.mark { display: block; width: 64px; height: 64px; margin: 0 auto; }
.mark-draw g path { stroke-dasharray: 1 2; stroke-dashoffset: 0; }
.mark-draw .mark-sparkle { transform-box: fill-box; transform-origin: center; }
.js .mark-draw g path { animation: mark-draw 1.6s cubic-bezier(0.6, 0.05, 0.3, 1) both; }
.js .mark-draw g path:nth-of-type(3) { animation-duration: 1.8s; }
.js .mark-draw g path:nth-of-type(2) { animation-delay: 0.45s; }
.js .mark-draw g path:nth-of-type(1) { animation-delay: 0.7s; }
.js .mark-draw .mark-sparkle { animation: sparkle-pop 0.9s var(--ease) 1.4s both; }
@keyframes mark-draw { from { stroke-dashoffset: 1.02; } to { stroke-dashoffset: 0; } }
@keyframes sparkle-pop { from { opacity: 0; transform: scale(0.4); } to { opacity: 1; transform: none; } }

/* ---------- Buttons (double ink ring) ---------- */
.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px;
  padding: 0 26px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font-family: var(--body); font-style: italic; font-size: 17px; letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 0 0 3px transparent, 0 0 0 4px var(--ink-faint);
  transition: transform 0.35s var(--spring), box-shadow 0.35s, border-color 0.3s, background 0.3s, color 0.3s;
  white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; }
.btn:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: var(--gold);
  box-shadow: 0 0 0 3px transparent, 0 0 0 4px rgba(246, 217, 139, 0.4), 0 10px 26px -12px rgba(246, 217, 139, 0.7);
}
.btn:active:not(:disabled) { transform: translateY(0) scale(0.97); transition-duration: 0.08s; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:focus-visible { border-radius: 999px; outline-offset: 6px; }
.btn-primary { color: var(--plum); background: linear-gradient(180deg, #ffe1ee, var(--blush) 60%, var(--rose)); border-color: #ffe1ee; }
.btn-primary:hover:not(:disabled) { background: linear-gradient(180deg, #fff0f6, #ffc9e2 60%, #f8b2d2); }
.btn-quiet { border-color: transparent; box-shadow: none; color: var(--soft); }
.btn-quiet:hover:not(:disabled) { color: var(--text); border-color: var(--ink-faint); box-shadow: none; }
.btn-small { min-height: 36px; padding: 0 16px; font-size: 15.5px; }
.btn-danger { color: #ffd2de; border-color: rgba(255, 168, 189, 0.6); }
.btn-danger:hover:not(:disabled) { border-color: var(--err); box-shadow: 0 0 0 3px transparent, 0 0 0 4px rgba(255, 168, 189, 0.35); }
.btn-danger.is-solid { background: #8d2f52; color: #fff; border-color: #b0496f; }

.link-ink {
  border: 0; background: none; padding: 2px 2px 4px;
  color: var(--blush);
  font-family: var(--body); font-style: italic; font-size: inherit;
  text-decoration: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 6' preserveAspectRatio='none'><path d='M1 3.5 C 15 1, 30 5.5, 50 3 S 85 1.5, 99 3.5' fill='none' stroke='%23ffb8d9' stroke-width='1.2' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 30% 5px;
  transition: background-size 0.45s var(--ease), color 0.2s;
}
.link-ink:hover, .link-ink:focus-visible { background-size: 100% 5px; color: #ffd6e8; }

.page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 26px !important; }
.page-actions.center { justify-content: center; }
.row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.row-actions form { margin: 0; }

/* ---------- Front page: one calm screen ---------- */
.landing { max-width: 620px; margin: 3vh auto 0; text-align: center; display: grid; justify-items: center; gap: 14px; }
.landing-mark { width: 72px; height: 72px; }
.landing-title { font-family: var(--display); font-style: italic; font-weight: 400; font-size: clamp(46px, 7vw, 68px); line-height: 1.05; letter-spacing: 0.03em; }
.landing-tagline { font-family: var(--display); font-style: italic; font-size: clamp(19px, 2.4vw, 23px); line-height: 1.4; max-width: 30em; text-wrap: balance; }
.landing-text { color: var(--soft); font-size: 17px; max-width: 34em; text-wrap: pretty; }
.landing-title, .landing-tagline, .landing-text, .landing-signin, .landing-hello { text-shadow: 0 0 14px var(--night-0), 0 0 4px var(--night-0); }
.landing-signin { color: var(--soft); font-size: 16px; }
.landing-hello { font-size: 18px; margin-top: 10px; }
.landing .page-actions { margin-top: 6px !important; }
.landing > * { animation: page-in 0.9s var(--ease) both; }

.join-form {
  width: 100%; max-width: 540px; margin-top: 14px;
  padding: 24px 30px 26px;
  display: grid; justify-items: center; gap: 20px;
  text-align: left;
  background: rgba(27, 17, 48, 0.9);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border: 1px solid var(--ink-faint);
  border-radius: 16px;
  box-shadow: 0 24px 50px -30px rgba(4, 2, 12, 0.9);
}
.join-fields { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 18px 24px; align-items: start; }
.join-fields .field { margin: 0; }
.join-form .btn { min-width: 240px; }
.page .join-form { padding: 0; background: none; border: 0; box-shadow: none; margin-top: 22px !important; }
.page .join-fields { grid-template-columns: 1fr; gap: 20px; }

.how { max-width: 880px; margin: 16vh auto 0 !important; padding-top: 26px; text-align: center; border-top: 1px dashed var(--ink-faint); }
.how-title { font-family: var(--display); font-style: italic; font-weight: 400; font-size: 24px; color: var(--soft); }
.how-steps { list-style: none; margin: 22px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; counter-reset: step; }
.how-steps li { counter-increment: step; display: grid; justify-items: center; align-content: start; gap: 6px; }
.how-steps li::before {
  content: counter(step);
  display: grid; place-items: center; width: 36px; height: 36px; margin-bottom: 4px;
  border: 1px solid var(--ink); border-radius: 50%;
  font-family: var(--display); font-style: italic; font-size: 18px; color: var(--gold);
}
.how-steps h3 { font-family: var(--display); font-style: italic; font-weight: 400; font-size: 20px; }
.how-steps p { color: var(--soft); font-size: 15.5px; max-width: 22em; }

.list-number { text-align: center; font-family: var(--display); font-style: italic; font-size: 20px; color: var(--gold); }
.list-number strong { display: block; font-weight: 400; font-size: 44px; line-height: 1.1; color: var(--text); }
.field-static { font-family: var(--display); font-style: italic; font-size: 19px; padding: 4px 4px 6px; border-bottom: 1px dashed var(--ink-faint); overflow-wrap: anywhere; }

/* ---------- Stable cards ---------- */
.stable-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.stable-grid.single { grid-template-columns: 1fr; }
.stable-card {
  position: relative;
  display: grid; gap: 6px;
  padding: 20px 22px 18px;
  background: rgba(36, 23, 63, 0.82);
  border: 1px solid var(--ink-faint);
  border-radius: 14px;
  box-shadow: 0 22px 40px -28px rgba(4, 2, 12, 0.95);
  transition: transform 0.4s var(--spring), border-color 0.3s, box-shadow 0.4s;
  animation: rise 0.6s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 70ms);
}
.stable-card:hover, .stable-card:focus-within { transform: translateY(-3px); border-color: var(--ink); box-shadow: 0 0 0 4px rgba(246, 217, 139, 0.08), 0 26px 44px -26px rgba(246, 217, 139, 0.35); }
.stable-card.is-online { border-color: rgba(168, 240, 214, 0.35); }
.stable-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.stable-name { font-family: var(--display); font-style: italic; font-weight: 400; font-size: 22px; line-height: 1.25; overflow-wrap: anywhere; }
.stable-name a { color: var(--text); text-decoration: none; }
.stable-name a::after { content: ""; position: absolute; inset: 0; border-radius: 14px; }
.stable-name a:focus-visible { outline: none; }
.stable-name a:focus-visible::after { outline: 2px solid var(--gold); outline-offset: 3px; }
.stable-host { font-size: 15px; color: var(--soft); font-style: italic; }
.stable-desc { font-size: 15.5px; color: var(--soft); display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.stable-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 6px; font-size: 14.5px; color: var(--soft); }
.stable-meta span { display: inline-flex; align-items: center; gap: 6px; }
.stable-meta svg { width: 17px; height: 17px; color: var(--gold); }

.status { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; font-variant: small-caps; letter-spacing: 0.1em; font-size: 14.5px; color: var(--soft); }
.status::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: rgba(215, 200, 234, 0.45); }
.status.is-online { color: var(--ok); }
.status.is-online::before { background: var(--ok); box-shadow: 0 0 8px 1px rgba(168, 240, 214, 0.6); }
.status.is-hidden { color: var(--err); }
.status.is-hidden::before { background: var(--err); }

.tag { display: inline-flex; align-items: center; gap: 6px; padding: 1px 11px; border: 1px solid var(--ink-faint); border-radius: 999px; font-size: 13.5px; font-variant: small-caps; letter-spacing: 0.08em; color: var(--soft); }
.tag.is-warn { color: var(--warn); border-color: rgba(255, 224, 138, 0.4); }
.tag.is-err { color: var(--err); border-color: rgba(255, 168, 189, 0.45); }

.empty { display: grid; justify-items: center; gap: 10px; text-align: center; padding: 30px 10px; color: var(--soft); }
.empty svg { width: 46px; height: 46px; color: var(--gold); opacity: 0.85; }
.empty-title { font-family: var(--display); font-style: italic; font-size: 22px; color: var(--text); }


.prose { margin: 0; padding-left: 24px; display: grid; gap: 12px; color: var(--soft); font-size: 16.5px; text-align: left; }
.prose li::marker { content: "\2726  "; color: var(--gold); font-size: 12px; }
ol.prose { list-style: decimal; }
ol.prose li::marker { content: counter(list-item) ".  "; font-family: var(--display); font-style: italic; font-size: 16px; color: var(--gold); }
.prose strong { color: var(--text); }

/* Download page and card */
.btn-big { min-height: 54px; padding: 0 38px; font-size: 19px; }
.install-steps { gap: 10px; }
.download-card {
  max-width: 900px; margin-left: auto; margin-right: auto;
  display: flex; align-items: center; justify-content: space-between; gap: 14px 24px; flex-wrap: wrap;
  padding: 20px 26px;
  background: rgba(27, 17, 48, 0.9);
  border: 1px solid var(--ink); border-radius: 16px;
  box-shadow: 0 24px 50px -30px rgba(4, 2, 12, 0.9);
}
.download-card-title { font-family: var(--display); font-style: italic; font-weight: 400; font-size: 22px; }
.page .download-card { margin-top: 24px !important; padding: 18px 20px; text-align: left; }

/* Patch notes (Markdown, rendered safely) */
.notes { color: var(--soft); text-align: left; overflow-wrap: anywhere; }
.notes > * + * { margin-top: 8px; }
.notes h1, .notes h2, .notes h3 { font-family: var(--display); font-style: italic; font-weight: 400; font-size: 19px; color: var(--text); margin-top: 16px; }
.notes ul, .notes ol { margin: 6px 0 0; padding-left: 24px; display: grid; gap: 6px; }
.notes li::marker { color: var(--gold); }
.notes strong { color: var(--text); }
.release-notes .quiet-note { margin-top: 2px; }

/* ---------- Server detail ---------- */
.detail-head { display: grid; justify-items: center; gap: 8px; text-align: center; }
.detail-host { font-style: italic; color: var(--soft); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; margin: 24px 0 0; padding: 0; }
.facts div { display: grid; align-content: start; gap: 2px; padding: 12px 4px; border-top: 1px dashed var(--ink-faint); text-align: center; }
.facts dt { font-variant: small-caps; letter-spacing: 0.12em; font-size: 14px; color: var(--gold); }
.facts dd { margin: 0; font-family: var(--display); font-style: italic; font-size: 19px; overflow-wrap: anywhere; }
.description { white-space: pre-line; overflow-wrap: anywhere; font-size: 17px; }
.arrivals { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; }
.arrivals li { font-family: var(--display); font-style: italic; font-size: 18px; }
.arrivals li::before { content: "\2726"; color: var(--gold); margin-right: 8px; font-style: normal; font-size: 13px; }

details.report { margin-top: 30px !important; padding-top: 18px; border-top: 1px dashed var(--ink-faint); }
details.report summary { cursor: pointer; color: var(--soft); font-style: italic; list-style: none; text-align: center; }
details.report summary::-webkit-details-marker { display: none; }
details.report summary:hover { color: var(--text); }
details.report[open] summary { color: var(--text); margin-bottom: 8px; }

/* ---------- Forms (ink lines, not boxes) ---------- */
.form { display: grid; gap: 0; }
.field { display: grid; gap: 6px; margin: 22px 0 0; padding: 0; border: 0; min-width: 0; }
.field:first-child { margin-top: 0; }
.field-label { font-variant: small-caps; letter-spacing: 0.1em; font-size: 15.5px; color: var(--gold); padding: 0; }
.field-help { font-size: 14.5px; color: var(--soft); }
.field-error { font-size: 15px; color: var(--err); font-style: italic; }
.input, .select, .textarea {
  font-family: var(--body); font-size: 17px;
  color: var(--text);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--ink);
  border-radius: 0;
  min-height: 42px;
  padding: 0 4px;
  width: 100%;
  transition: border-color 0.3s, box-shadow 0.4s var(--ease);
}
.textarea { padding: 8px 4px; min-height: 96px; resize: vertical; line-height: 1.5; background: rgba(255, 255, 255, 0.02); }
.input::placeholder, .textarea::placeholder { color: rgba(215, 200, 234, 0.72); font-style: italic; }
.input:hover, .select:hover, .textarea:hover { border-bottom-color: var(--gold); }
.input:focus, .select:focus, .textarea:focus { border-bottom-color: var(--gold); box-shadow: 0 10px 18px -14px rgba(246, 217, 139, 0.9); }
/* Fields keep the ink-line look when focused: a thicker gold line with a soft glow instead of a box. */
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { outline: none; box-shadow: 0 2px 0 0 var(--gold), 0 12px 20px -12px rgba(246, 217, 139, 0.9); }
.danger .field { width: min(380px, 100%); margin-top: 6px; }
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] { border-bottom-color: var(--err); }
.select { cursor: pointer; }
.select option { background: var(--paper-solid); color: var(--text); }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 26px; }
.field-row .field:first-child { margin-top: 22px; }
.form > .field-row:first-child .field { margin-top: 0; }

.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; color: var(--soft); font-style: italic; }
.check input { width: 18px; height: 18px; accent-color: var(--blush); cursor: pointer; }
.check:hover { color: var(--text); }

.choices { display: flex; flex-wrap: wrap; gap: 8px; border: 0; margin: 0; padding: 0; }
.choice { position: relative; cursor: pointer; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.choice span { display: block; min-width: 64px; padding: 6px 16px; border: 1px solid var(--ink); border-radius: 999px; text-align: center; font-style: italic; color: var(--soft); transition: background 0.25s, color 0.25s, transform 0.35s var(--spring), border-color 0.25s; }
.choice:hover span { transform: translateY(-2px); color: var(--text); }
.choice input:checked + span { background: rgba(255, 184, 217, 0.22); border-color: var(--blush); color: var(--text); }
.choice input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 3px; }

.search { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto auto; gap: 14px 22px; align-items: end; }
.search .field { margin: 0; }
.search .check { min-height: 42px; }

.danger { margin-top: 36px !important; padding-top: 22px; border-top: 1px dashed rgba(255, 168, 189, 0.35); display: grid; gap: 10px; justify-items: start; }
.danger .section-title { color: #ffc6d6; }

/* ---------- Lists (my stables, tokens, admin) ---------- */
.rows { list-style: none; margin: 0; padding: 0; }
.row { display: grid; grid-template-columns: 1fr auto; gap: 6px 18px; align-items: center; padding: 16px 4px; border-bottom: 1px dashed var(--ink-faint); animation: rise 0.6s var(--ease) both; animation-delay: calc(var(--i, 0) * 60ms); }
.row:last-child { border-bottom: 0; }
.row-main { display: grid; gap: 4px; min-width: 0; }
.row-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.row-name { font-family: var(--display); font-style: italic; font-size: 20px; overflow-wrap: anywhere; }
.row-meta { font-size: 14.5px; color: var(--soft); overflow-wrap: anywhere; }
.row-note { font-size: 14.5px; color: var(--warn); font-style: italic; }
.id-chip { font-family: var(--mono); font-size: 13px; color: var(--soft); }
.invite-link code { display: inline-block; max-width: 100%; user-select: all; }
.row.is-new { background: rgba(246, 217, 139, 0.06); border-radius: 10px; }
.row-actions details { position: relative; }
summary.btn { list-style: none; }
summary.btn::-webkit-details-marker { display: none; }
.row-actions details[open] > .form { position: absolute; right: 0; top: calc(100% + 10px); z-index: 5; width: min(340px, 80vw); padding: 16px 18px 18px; background: var(--paper-solid); border: 1px solid var(--ink); border-radius: 12px; box-shadow: 0 20px 40px -18px rgba(0, 0, 0, 0.9); display: grid; gap: 12px; }
.row-actions details[open] > .form .field { margin: 0; }

.alert { padding: 12px 18px; border-radius: 10px; border: 1px solid var(--ink); background: rgba(36, 23, 63, 0.9); font-size: 15.5px; }
.alert.is-error { border-color: rgba(255, 168, 189, 0.6); color: #ffd2de; }
.alert.is-ok { border-color: rgba(168, 240, 214, 0.5); }

.pagination { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 14px; margin-top: 26px !important; font-style: italic; }
.pagination .current { font-family: var(--display); color: var(--gold); padding: 2px 8px; border-bottom: 1px solid var(--gold); }
.pagination .gap { color: var(--soft); }
.pagination .disabled { color: rgba(215, 200, 234, 0.5); }

.tabs { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 22px; }

/* ---------- Statistics (Moderation): cards and server-drawn SVG charts ---------- */
.stat-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.stat-card { display: grid; justify-items: center; gap: 2px; padding: 16px 12px 14px; text-align: center; background: rgba(36, 23, 63, 0.82); border: 1px solid var(--ink-faint); border-radius: 14px; animation: rise 0.6s var(--ease) both; }
.stat-number { font-family: var(--display); font-style: italic; font-size: 38px; line-height: 1.1; }
.stat-label { font-variant: small-caps; letter-spacing: 0.1em; font-size: 14.5px; color: var(--gold); }
.charts { display: grid; gap: 18px; }
.chart-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.chart-card { margin: 0; padding: 16px 18px 12px; display: grid; gap: 8px; background: rgba(36, 23, 63, 0.6); border: 1px solid var(--ink-faint); border-radius: 14px; }
.chart-card figcaption { display: grid; gap: 2px; }
.chart-title { font-family: var(--display); font-style: italic; font-size: 20px; }
.chart-note { font-size: 14.5px; color: var(--soft); }
.chart { display: block; width: 100%; height: auto; }
.chart text { fill: var(--soft); font-family: var(--body); font-size: 11.5px; }
.chart-grid { stroke: rgba(246, 217, 139, 0.16); stroke-dasharray: 3 4; }
.chart-axis { stroke: var(--ink); }
.chart-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-hit { fill: transparent; }
.chart-hit:hover { fill: rgba(251, 243, 255, 0.07); }
.chart-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 14.5px; color: var(--soft); }
.chart-legend li { display: inline-flex; align-items: center; gap: 7px; }
.chart-legend li::before { content: ""; width: 11px; height: 11px; border-radius: 3px; background: var(--c); }

/* ---------- Toasts ---------- */
.toasts { position: fixed; right: 22px; bottom: 22px; z-index: 80; display: grid; gap: 10px; width: min(400px, calc(100vw - 44px)); }
.toast {
  display: grid; grid-template-columns: 20px 1fr auto; gap: 10px; align-items: start;
  padding: 13px 10px 13px 16px;
  background: var(--paper-solid);
  border: 1px solid var(--ink);
  border-radius: 10px;
  box-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.9);
  animation: toast-in 0.55s var(--spring) both;
}
.toast.is-success { border-color: rgba(168, 240, 214, 0.5); }
.toast.is-error { border-color: rgba(255, 168, 189, 0.6); }
.toast.is-leaving { animation: toast-out 0.3s ease-in both; }
.toast > svg { width: 20px; height: 20px; margin-top: 3px; color: var(--ok); }
.toast.is-error > svg { color: var(--err); }
.toast-text { font-size: 15.5px; overflow-wrap: anywhere; }
.toast-close { width: 30px; height: 30px; border: 0; border-radius: 8px; background: transparent; color: var(--soft); display: grid; place-items: center; cursor: pointer; }
.toast-close svg { width: 16px; height: 16px; }
.toast-close:hover { color: var(--text); background: rgba(251, 243, 255, 0.08); }
@keyframes toast-in { from { opacity: 0; transform: translateY(14px) rotate(-1deg); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }

/* ---------- Sheet (confirm dialog) ---------- */
.sheet {
  margin: auto auto 0;
  padding: 0;
  width: min(480px, calc(100vw - 32px));
  max-height: 80vh;
  color: var(--text);
  background: var(--paper-solid);
  border: 1px solid var(--ink);
  border-bottom: 0;
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -20px 60px -20px rgba(0, 0, 0, 0.8);
}
.sheet[open] { animation: sheet-up 0.55s var(--spring) both; }
.sheet::backdrop { background: rgba(10, 6, 22, 0.6); }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
.sheet-inner { padding: 20px 28px 26px; display: grid; gap: 12px; }
.sheet-ornament { width: 160px; height: 14px; margin: 0 auto; color: var(--ink); }
.sheet-title { font-family: var(--display); font-style: italic; font-weight: 400; font-size: 26px; text-align: center; }
.sheet-body { color: var(--soft); text-align: center; }
.sheet-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 8px; }

/* ---------- Reduced motion: a still storybook ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .fx-canvas, .scene-horse { display: none !important; }
}

/* ---------- Smaller screens ---------- */
@media (max-width: 860px) {
  .search { grid-template-columns: 1fr 1fr; }
  .search .field:first-child { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .site-header { padding-top: 14px; }
  .brand-mark { width: 34px; height: 34px; }
  .brand-name { font-size: 22px; }
  .nav { margin-left: auto; justify-content: flex-end; gap: 2px 14px; }
  .nav-link { font-size: 16px; }
  .page { padding: 34px 22px 30px; }
  .corner { width: 40px; height: 40px; }
  .page-title { font-size: 28px; }
  .landing { margin-top: 1vh; gap: 12px; }
  .landing-mark { width: 60px; height: 60px; }
  .landing-text { font-size: 16px; }
  .join-form { padding: 20px 18px 22px; }
  .join-fields { grid-template-columns: 1fr; }
  .join-form .btn { width: 100%; min-width: 0; }
  .how { margin-top: 64px !important; }
  .how-steps { grid-template-columns: 1fr; gap: 24px; }
  .page.plain { padding: 30px 22px 28px; }
  .row { grid-template-columns: 1fr; }
  .search { grid-template-columns: 1fr; }
  .search .field:first-child { grid-column: auto; }
  .page-actions .btn { flex: 1 1 auto; }
  .stable-head { flex-direction: column-reverse; align-items: flex-start; gap: 2px; }
  /* The meadow is drawn for wide windows; on a tall phone it sits behind the text, so dim it. */
  .vignette { background: linear-gradient(180deg, rgba(16, 9, 30, 0.25), rgba(16, 9, 30, 0.6)); }
  .toasts { right: 12px; bottom: 12px; width: calc(100vw - 24px); }
}
