/* Famulus website.
   Colours follow the addon's colour schemes (Famulus/UI/Theme.lua): every
   ground comes from one lightness ladder in the scheme's hue, and the accent
   is a pair that runs from a base tone into a brighter one. Accent, gradient
   and glow stand for "active / here" only. */

@font-face { font-family: "Inter"; src: url("assets/fonts/Inter-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("assets/fonts/Inter-Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Inter"; src: url("assets/fonts/Inter-SemiBold.ttf") format("truetype"); font-weight: 600; font-display: swap; }

:root {
  /* Always dark: scrollbars and the browser's own parts of fields too. */
  color-scheme: dark;
  /* The colour scheme: hue and saturation of the grounds, and the accent. */
  --h: 190;
  --s: 19%;
  --accent: #f2d640;
  --accent2: #fff29a;
  --on-accent: #2a2404;

  /* The ladder, as in the addon. */
  --bg: hsl(var(--h) var(--s) 5%);
  --sidebar: hsl(var(--h) var(--s) 7%);
  --window: hsl(var(--h) var(--s) 9.2%);
  --card: hsl(var(--h) var(--s) 12.5%);
  --card-border: hsl(var(--h) calc(var(--s) * 0.9) 18.5%);
  --control: hsl(var(--h) var(--s) 15%);
  --control-border: hsl(var(--h) calc(var(--s) * 0.9) 23%);
  --field: hsl(var(--h) var(--s) 5.5%);
  --divider: hsl(var(--h) calc(var(--s) * 0.9) 16%);
  --track: hsl(var(--h) calc(var(--s) * 0.9) 24%);
  --text: hsl(var(--h) calc(var(--s) * 0.9) 94.5%);
  --text-dim: hsl(var(--h) calc(var(--s) * 0.5) 74%);
  --text-muted: hsl(var(--h) calc(var(--s) * 0.42) 53.5%);

  --accent-soft: color-mix(in srgb, var(--accent) 16%, transparent);
  --accent-line: color-mix(in srgb, var(--accent) 55%, transparent);
  --accent-glow: color-mix(in srgb, var(--accent) 45%, transparent);
  --accent-deep: color-mix(in srgb, var(--accent) 20%, #000);
  --accent-trail: color-mix(in srgb, var(--accent) 28%, transparent);
  --card-active: color-mix(in srgb, var(--accent) 26%, transparent);
  --hairline: rgb(255 255 255 / 0.08);
  --sheen: inset 0 1px 0 rgb(255 255 255 / 0.07);

  /* The landscape: sky, then ridges from far (1) to the ground of the page (5). */
  --sky-top: hsl(var(--h) calc(var(--s) * 1.9) 4%);
  --sky-mid: hsl(var(--h) calc(var(--s) * 2.1) 10%);
  --sky-low: hsl(var(--h) calc(var(--s) * 2) 27%);
  --r1a: hsl(var(--h) calc(var(--s) * 1.8) 18%);
  --r1b: color-mix(in srgb, var(--accent) 7%, hsl(var(--h) calc(var(--s) * 1.8) 26%));
  --r2a: hsl(var(--h) calc(var(--s) * 1.7) 12.5%);
  --r2b: hsl(var(--h) calc(var(--s) * 1.7) 19%);
  --r3a: hsl(var(--h) calc(var(--s) * 1.6) 9%);
  --r3b: hsl(var(--h) calc(var(--s) * 1.5) 14.5%);
  --r4a: hsl(var(--h) calc(var(--s) * 1.4) 6.6%);
  --r4b: hsl(var(--h) calc(var(--s) * 1.3) 10%);
  --r5a: var(--bg);
  --r5b: var(--bg);
  /* The camp at the fire: friends and animals, the flame, the moons. */
  --figure: hsl(var(--h) calc(var(--s) * 1.5) 3%);
  --flame-base: color-mix(in srgb, var(--accent) 72%, #8a3c00);
  --flame-inner: color-mix(in srgb, var(--accent2) 70%, #fff);
  --flame-core: color-mix(in srgb, var(--accent2) 15%, #fff);
  --moon-mid: color-mix(in srgb, var(--accent2) 50%, #fff);
  --moon-rim: color-mix(in srgb, var(--accent) 62%, #fff);
  --moon-blue: hsl(calc(var(--h) + 18) 46% 78%);

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --wrap: 1120px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1.2 0 0 0 -.25'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}


/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

/* Fine grain over everything, as on the addon's window. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  background-image: var(--grain);
  opacity: 0.055;
}

h1, h2, h3, h4, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: color-mix(in srgb, var(--accent) 36%, transparent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
/* For screen readers only. */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.icon { fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.wrap { width: min(var(--wrap), 100% - 48px); margin-inline: auto; }

.skip { position: fixed; left: 16px; top: -60px; z-index: 100; padding: 10px 16px; border-radius: 8px; background: var(--accent); color: var(--on-accent); font-weight: 600; transition: top 0.2s; }
.skip:focus { top: 16px; }

h1, h2 { font-weight: 600; letter-spacing: -0.035em; text-wrap: balance; }
h1 { font-size: clamp(2.7rem, 7vw, 5.6rem); line-height: 0.98; }
h2 { font-size: clamp(2rem, 4.6vw, 3.6rem); line-height: 1.04; }
.lead { font-size: clamp(1.06rem, 1.45vw, 1.25rem); line-height: 1.55; color: var(--text-dim); max-width: 60ch; text-wrap: pretty; }

.eyebrow { display: flex; align-items: center; gap: 12px; font-size: 12.5px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); }
.eyebrow__mark { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px 2px var(--accent-glow); }
.eyebrow__num { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.eyebrow__num::after { content: ""; display: inline-block; width: 28px; height: 1px; margin-left: 12px; vertical-align: middle; background: var(--text-muted); opacity: 0.6; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 48px; padding: 0 24px;
  border: 1px solid transparent; border-radius: 11px;
  font-size: 15px; font-weight: 600; letter-spacing: -0.005em; white-space: nowrap;
  transition: transform 0.25s var(--ease), box-shadow 0.25s, background-color 0.25s, border-color 0.25s;
}
.btn--small { height: 36px; padding: 0 16px; border-radius: 9px; font-size: 13.5px; }
/* The main button as in the window: a level gradient, a darker rim, a light line inside. */
.btn--primary {
  color: var(--on-accent);
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-color: color-mix(in srgb, var(--accent) 62%, #000);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.4), 0 10px 28px -10px var(--accent-glow), 0 2px 6px rgb(0 0 0 / 0.4);
}
.btn--primary:hover { transform: translateY(-1px); box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.4), 0 14px 34px -8px var(--accent-glow), 0 2px 6px rgb(0 0 0 / 0.4); }
.btn--ghost { background: rgb(255 255 255 / 0.05); border-color: rgb(255 255 255 / 0.14); backdrop-filter: blur(8px); }
.btn--ghost:hover { background: rgb(255 255 255 / 0.09); border-color: rgb(255 255 255 / 0.24); }
.btn.is-disabled { cursor: default; filter: saturate(0.5); opacity: 0.6; box-shadow: none; }
.btn.is-disabled:hover { transform: none; }

/* Things that come in as they are reached. Only hidden when scripts run. */
.js .reveal { opacity: 0; transform: translate3d(0, 22px, 0); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); transition-delay: calc(var(--i, 0) * 80ms); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* ---------- Navigation ---------- */

.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: 68px; display: flex; align-items: center; gap: 28px;
  padding: 0 max(24px, calc((100vw - var(--wrap)) / 2));
  border-bottom: 1px solid transparent;
  transition: background-color 0.35s, border-color 0.35s;
}
.nav.is-stuck { background: hsl(var(--h) var(--s) 5% / 0.74); border-bottom-color: var(--hairline); backdrop-filter: blur(16px) saturate(1.3); -webkit-backdrop-filter: blur(16px) saturate(1.3); }
.nav__brand { display: flex; align-items: center; gap: 9px; font-size: 17px; font-weight: 600; letter-spacing: -0.02em; }
.nav__links { display: flex; gap: 4px; margin-left: 14px; }
.nav__links a { position: relative; padding: 8px 12px; font-size: 14px; color: var(--text-dim); border-radius: 8px; transition: color 0.2s; }
.nav__links a:hover { color: var(--text); }
.nav__links a.is-here { color: var(--text); }
.nav__links a::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 2px; border-radius: 1px; background: linear-gradient(90deg, var(--accent), var(--accent2)); box-shadow: 0 0 10px var(--accent-glow); opacity: 0; transform: scaleX(0.4); transition: opacity 0.3s, transform 0.3s var(--ease); }
.nav__links a.is-here::after { opacity: 1; transform: none; }
.nav__end { margin-left: auto; display: flex; align-items: center; gap: 14px; }

.lang { display: flex; padding: 3px; border-radius: 9px; background: rgb(255 255 255 / 0.05); border: 1px solid var(--hairline); }
.lang button { padding: 4px 9px; border: 0; border-radius: 6px; background: none; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; color: var(--text-muted); transition: color 0.2s, background-color 0.2s; }
.lang button:hover { color: var(--text); }
.lang button[aria-pressed="true"] { background: rgb(255 255 255 / 0.1); color: var(--text); }

/* ---------- The landscape ---------- */

.scene { position: absolute; inset: 0; overflow: hidden; background: linear-gradient(180deg, var(--sky-top), var(--sky-mid) 30%, var(--sky-low) 64%); }
.layer { position: absolute; will-change: transform; }
.ridge { left: -4%; bottom: 0; width: 108%; height: 100%; }
.scene__stars { inset: 0; width: 100%; height: 100%; fill: #fff; }
.scene__glow { inset: 0; background: radial-gradient(58% 44% at 62% 72%, color-mix(in srgb, var(--accent) 30%, transparent), transparent 72%); }
.moon {
  position: absolute; right: 15%; top: 15%;
  width: clamp(84px, 10.5vw, 164px); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 36% 34%, #fff, color-mix(in srgb, var(--accent2) 50%, #fff) 55%, color-mix(in srgb, var(--accent) 62%, #fff));
  box-shadow: 0 0 50px 6px color-mix(in srgb, var(--accent2) 38%, transparent), 0 0 190px 70px color-mix(in srgb, var(--accent) 17%, transparent);
}
.scene__embers { left: -4%; bottom: 0; width: 108%; height: 100%; pointer-events: none; }
.scene__embers i { position: absolute; width: var(--size); height: var(--size); border-radius: 50%; background: var(--accent2); box-shadow: 0 0 7px 1px var(--accent-glow); opacity: 0; animation: ember var(--time) linear infinite; }
.is-away .scene__embers i, .is-away .twinkle { animation-play-state: paused; }
.twinkle { animation: twinkle 5s ease-in-out infinite; }

@keyframes ember {
  0% { transform: translate3d(0, 0, 0) scale(1); opacity: 0; }
  7% { opacity: 0.95; }
  55% { opacity: 0.55; }
  100% { transform: translate3d(var(--drift), var(--rise), 0) scale(0.35); opacity: 0; }
}
@keyframes twinkle { 50% { opacity: 0.1; } }

/* The flame of the camp: three tongues, each flickering at its own pace. */
.camp__flame path { transform-box: fill-box; transform-origin: 50% 100%; animation: flicker 2.3s ease-in-out infinite alternate; }
.camp__flame path:nth-child(2) { animation-duration: 1.5s; animation-delay: -0.6s; }
.camp__flame path:nth-child(3) { animation-duration: 1.1s; animation-delay: -0.3s; }
.is-away .camp__flame path { animation-play-state: paused; }
@keyframes flicker {
  0% { transform: scale(1, 1) skewX(0deg); }
  25% { transform: scale(0.95, 1.07) skewX(-3deg); }
  50% { transform: scale(1.03, 0.94) skewX(2deg); }
  75% { transform: scale(0.97, 1.05) skewX(-1.5deg); }
  100% { transform: scale(1.02, 0.97) skewX(2.5deg); }
}

/* Bats crossing the moon, beating their wings. */
.bat { animation: bat-fly 32s linear infinite; }
.bat__wings { transform-box: fill-box; transform-origin: 50% 40%; animation: bat-flap 0.45s ease-in-out infinite alternate; }
@keyframes bat-fly {
  0% { transform: translate(300px, 40px); opacity: 0; }
  8%, 88% { opacity: 1; }
  100% { transform: translate(-360px, -50px); opacity: 0; }
}
@keyframes bat-flap { to { transform: scaleY(-0.45); } }

/* Fireflies: wandering, glowing up and fading. */
.fly { fill: var(--accent2); opacity: 0.7; filter: drop-shadow(0 0 3px var(--accent)); animation: fly-drift 9s ease-in-out infinite alternate, fly-glow 3s ease-in-out infinite; }
@keyframes fly-drift { to { transform: translate(var(--dx), var(--dy)); } }
@keyframes fly-glow { 0%, 100% { opacity: 0.1; } 50% { opacity: 1; } }
.is-away .bat, .is-away .bat__wings, .is-away .fly { animation-play-state: paused; }

/* ---------- Hero ---------- */

/* How far the addon's window rises into the hero (.shot); the text keeps that
   much and a gap free below it, so the window never covers it. */
:root { --lift: clamp(150px, 22svh, 240px); }
.hero { position: relative; isolation: isolate; min-height: max(100svh, 700px); display: flex; align-items: flex-start; overflow: clip; }
.hero > .scene { z-index: -2; }
.hero__shade { position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, hsl(var(--h) calc(var(--s) * 1.6) 4% / 0.66), transparent 58%); pointer-events: none; }
.hero__inner { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); align-items: center; gap: 48px; padding: 140px 0 calc(var(--lift) + 40px); }
.hero__copy { will-change: transform, opacity; }
.hero h1 { margin: 22px 0 26px; }
/* Two lines in every language: the break stands in the text, and the font
   shrinks until the longer line fits the column (it is that many em wide:
   "you play with." 6.2, "Für alle, mit denen" 8.2). */
.hero__copy { container-type: inline-size; }
.hero h1 { font-size: min(clamp(2.7rem, 7vw, 5.6rem), var(--title-fit, 100cqi)); }
:lang(en) .hero h1 { --title-fit: 15.5cqi; }
:lang(de) .hero h1 { --title-fit: 11.9cqi; }
.hero h1 em { font-style: normal; background: linear-gradient(90deg, var(--accent), var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: 0.06em; }
.hero .lead { max-width: 52ch; color: hsl(var(--h) calc(var(--s) * 0.6) 82%); }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.hero__facts { display: flex; flex-wrap: wrap; gap: 6px 0; margin-top: 34px; font-size: 13px; color: var(--text-muted); }
.hero__facts li + li::before { content: "·"; margin: 0 12px; opacity: 0.7; }

/* The addon's window below the camp: it rises into the foot of the hero and
   fades into the page further down, as if the screenshot went on. The window
   is 1180 x 730 in the game; its corners are 12 of those. */
.shot { position: relative; z-index: 1; width: min(1180px, 100% - 48px); margin: calc(-1 * var(--lift)) auto 0; }
.shot::before { content: ""; position: absolute; inset: -14% 4% 40%; z-index: -1; background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 13%, transparent), transparent); pointer-events: none; }
.shot__frame { -webkit-mask-image: linear-gradient(180deg, #000 56%, transparent 96%); mask-image: linear-gradient(180deg, #000 56%, transparent 96%); }
.shot__window { display: block; width: 100%; height: auto; border-radius: calc(12 / 1180 * 100%) / calc(12 / 730 * 100%); }
/* Live feed cards over the lower end of the window's right column, below its
   friends list, where the window fades; flush with its right edge and a little
   past it, as Polestar lays its second window over the first. */
.shot__feed { position: absolute; top: 70%; right: -44px; width: 400px; }
.shot__feed .toast { left: auto; right: 0; }
/* The first section's glow drifts up into the window's fading foot instead of
   being cut off at the section's top edge. */
.shot + .section { overflow: visible; overflow-x: clip; }

/* ---------- Sections ---------- */

.section { position: relative; isolation: isolate; overflow: clip; padding: clamp(92px, 12vw, 168px) 0; }
.section--tinted { background: linear-gradient(180deg, hsl(var(--h) var(--s) 6.8%), var(--bg) 70%); border-top: 1px solid var(--hairline); }
.section__head { max-width: 780px; margin-bottom: clamp(44px, 6vw, 76px); }
.section__head h2 { margin: 20px 0 22px; }

.glow { position: absolute; z-index: -1; width: min(70vw, 900px); aspect-ratio: 1; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 10%, transparent), transparent); pointer-events: none; will-change: transform; }
.glow--right { right: -22%; top: 2%; }
.glow--left { left: -24%; top: 18%; }

.hint { margin-top: 22px; font-size: 14px; color: var(--text-muted); }

.points { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; margin-top: clamp(56px, 8vw, 96px); }
.points li { padding-top: 22px; border-top: 1px solid var(--hairline); position: relative; }
.points li::before { content: ""; position: absolute; left: 0; top: -1px; width: 36px; height: 1px; background: linear-gradient(90deg, var(--accent), transparent); }
.points h3, .steps h3 { font-size: 17px; font-weight: 600; letter-spacing: -0.015em; }
.points p, .steps p { margin-top: 8px; font-size: 15px; color: var(--text-dim); text-wrap: pretty; }

/* ---------- The addon's window ---------- */

/* The window above, the game below it: what you change there shows here. */
.duo { display: grid; gap: 20px; }

/* As in the addon: the main features stand as tabs in a head across the
   top, the sidebar belongs to the chosen one (its name, master switch and
   sections), the content is headed by the chosen section. Head and sidebar
   share one dark ground; one line runs under the head over the content and
   one between sidebar and content. */
.fwin {
  --side: 214px; --head: 64px;
  position: relative; display: grid; grid-template-columns: var(--side) minmax(0, 1fr); grid-template-rows: var(--head) minmax(0, 1fr);
  min-height: 500px; border-radius: 14px; overflow: hidden;
  background: var(--window); border: 1px solid var(--card-border);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.1), 0 60px 100px -50px rgb(0 0 0 / 0.9), 0 24px 50px -24px rgb(0 0 0 / 0.7);
  font-size: 13.5px; line-height: 1.45;
}
/* The band of grain in the height of the head, running out below it. */
.fwin::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 130px; background-image: var(--grain); opacity: 0.09; -webkit-mask-image: linear-gradient(#000 45%, transparent); mask-image: linear-gradient(#000 45%, transparent); pointer-events: none; }
.fwin h3, .fwin h4 { letter-spacing: -0.01em; }

.fwin__brand { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 0 16px; background: var(--sidebar); }
.fwin__brand strong { display: block; font-size: 15px; font-weight: 600; }
.fwin__brand span { display: block; font-size: 10.5px; color: var(--text-muted); line-height: 1.3; white-space: nowrap; }
.fwin__logo { position: relative; flex: none; }
.fwin__logo::before { content: ""; position: absolute; inset: -16px; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 24%, transparent), transparent); }
.fwin__logo img { position: relative; }

/* The tabs sit on the line below the head, the chosen one with a glowing
   stroke on it. The addon's own pages stand at the right end. */
.fwin__top { display: flex; align-items: flex-end; gap: 4px; min-width: 0; padding: 0 12px 8px; background: var(--sidebar); }
.fwin__area { position: relative; display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; border-radius: 8px; font-weight: 500; color: var(--text-dim); white-space: nowrap; }
.fwin__area .icon { color: var(--text-muted); }
.fwin__area b { padding: 1px 7px; border-radius: 9px; background: rgb(255 255 255 / 0.06); font-size: 11px; font-weight: 500; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.fwin__area.is-active { color: var(--text); }
.fwin__area.is-active .icon { color: var(--accent); }
.fwin__area.is-active b { background: var(--accent-soft); color: var(--accent); }
.fwin__area.is-active::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -9px; height: 2px; border-radius: 1px; background: linear-gradient(90deg, var(--accent), var(--accent2)); box-shadow: 0 0 10px 1px var(--accent-glow); }
.fwin__area:not(.fwin__area--page) + .fwin__area--page { margin-left: auto; }
/* A switched-off feature is greyed out in the head and reads OFF. */
.fwin.is-off .fwin__area.is-active > span, .fwin.is-off .fwin__area.is-active .icon { opacity: 0.45; }
.fwin.is-off .fwin__area.is-active b { background: none; color: var(--text-muted); }
.fwin__close { display: grid; place-items: center; align-self: center; width: 28px; height: 28px; margin: 0 0 -8px 6px; border-radius: 7px; color: var(--text-muted); flex: none; }

.fwin__side { display: flex; flex-direction: column; min-width: 0; padding: 4px 12px 14px; background: var(--sidebar); }
.fwin__search { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 10px; margin-bottom: 20px; border-radius: 7px; background: var(--field); border: 1px solid var(--divider); font-size: 12px; color: var(--text-muted); }
.fwin__about { padding: 0 4px 16px; }
.fwin__name { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.fwin__name strong { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.fwin__about p { margin-top: 5px; font-size: 12px; line-height: 1.45; color: var(--text-muted); }
.fwin__tabs { display: grid; gap: 2px; }
.fwin__tabs button { position: relative; display: flex; align-items: center; height: 34px; padding: 0 12px; border: 0; border-radius: 8px; background: none; font-weight: 500; color: var(--text-dim); text-align: left; transition: color 0.2s, background-color 0.2s, opacity 0.25s; }
.fwin__tabs button:hover { color: var(--text); background-color: rgb(255 255 255 / 0.04); }
.fwin__tabs button[aria-selected="true"] { color: var(--text); background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 22%, transparent), color-mix(in srgb, var(--accent) 4%, transparent)); }
.fwin__tabs button[aria-selected="true"]::before { content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px; border-radius: 2px; background: linear-gradient(var(--accent2), var(--accent)); box-shadow: 0 0 10px 1px var(--accent-glow); }
/* The sections of a switched-off feature are greyed out. */
.fwin.is-off .fwin__tabs button { opacity: 0.7; } /* greyed, but still readable (4.5:1) */
.fwin.is-off .fwin__tabs button[aria-selected="true"] { background: rgb(255 255 255 / 0.04); }
.fwin.is-off .fwin__tabs button[aria-selected="true"]::before { background: var(--text-muted); box-shadow: none; }
.fwin__count { display: flex; align-items: center; gap: 8px; padding: 10px 6px 0; margin-top: auto; border-top: 1px solid var(--divider); font-size: 11px; color: var(--text-muted); }
.fwin__count i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 9px 2px var(--accent-glow); }

.fwin__main { position: relative; min-width: 0; padding: 22px 24px 24px; border-top: 1px solid var(--divider); border-left: 1px solid var(--divider); background: linear-gradient(180deg, transparent 40%, rgb(0 0 0 / 0.2)); }
.fwin__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.fwin__head h3 { font-size: 19px; font-weight: 600; }
.fwin__head p { margin-top: 3px; font-size: 12.5px; color: var(--text-muted); }
/* Reset asks first: a second click within a few seconds does it. */
.fwin__reset { flex: none; height: 30px; padding: 0 12px; border-radius: 7px; border: 1px solid var(--control-border); background: none; font-size: 12.5px; font-weight: 500; color: var(--text-dim); transition: color 0.2s, border-color 0.2s, background-color 0.2s, opacity 0.2s; }
.fwin__reset:hover:not(:disabled) { color: var(--text); background-color: rgb(255 255 255 / 0.05); }
.fwin__reset:disabled { opacity: 0.4; }
.fwin__reset.is-asking { color: #f06a6a; border-color: rgb(240 106 106 / 0.5); background-color: rgb(240 106 106 / 0.1); }
.fwin__reset[hidden] { display: none; }
.fwin__pane { display: grid; gap: 10px; }
.fwin__pane[hidden] { display: none; }

.fcard { position: relative; padding: 14px; border-radius: 10px; background: var(--card); border: 1px solid var(--card-border); box-shadow: var(--sheen); transition: border-color 0.3s; }
.fcard h4 { font-size: 13.5px; font-weight: 500; }
.fcard > h4 { margin-bottom: 10px; color: var(--text-dim); }
.fcard__row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.fcard__row p { margin-top: 3px; font-size: 12.5px; color: var(--text-muted); }
/* A running feature: a fine accent border and a mark on the left. */
.fcard--feature::before { content: ""; position: absolute; left: -1px; top: 15px; width: 3px; height: 16px; border-radius: 0 2px 2px 0; background: var(--accent); opacity: 0; transition: opacity 0.3s; }
.fcard--feature.is-on { border-color: var(--card-active); }
.fcard--feature.is-on::before { opacity: 1; }
.fcard__child { display: flex; align-items: center; gap: 10px; margin: 14px -14px -14px; padding: 9px 14px 9px 18px; border-top: 1px solid var(--divider); border-radius: 0 0 9px 9px; background: rgb(0 0 0 / 0.16); color: var(--text-dim); transition: opacity 0.3s; }
.fcard__child i { width: 5px; height: 5px; border-radius: 50%; background: var(--text-muted); }
.fcard__child select { margin-left: auto; }
.fcard--feature:not(.is-on) .fcard__child { opacity: 0.5; }

.fwin input[type="text"], .fwin select {
  height: 34px; min-width: 0; padding: 0 10px; border-radius: 7px;
  background: var(--field); border: 1px solid var(--control-border);
  outline: 0; transition: border-color 0.2s, box-shadow 0.2s;
}
.fwin input::placeholder { color: var(--text-muted); }
.fwin input[type="text"]:focus, .fwin select:focus-visible { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
.fwin select { background: var(--control); padding-right: 6px; }
.aliasform { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto; gap: 8px; }
.aliasform .btn { height: 34px; }

.aliaslist__empty { padding: 8px 0 4px; color: var(--text-muted); }
.aliaslist__empty strong { display: block; color: var(--text-dim); font-weight: 500; }
.aliasrow { display: flex; align-items: center; gap: 6px; margin: 0 -8px; padding: 0 8px; border-radius: 8px; transition: background-color 0.2s; }
.aliasrow + .aliasrow { margin-top: 2px; }
.aliasrow:hover { background: rgb(255 255 255 / 0.045); }
.aliasrow.is-editing { background: var(--accent-soft); }
.aliasrow__open { display: flex; align-items: center; gap: 11px; flex: 1; min-width: 0; padding: 7px 0; border: 0; background: none; text-align: left; }
.aliasrow__text { display: grid; min-width: 0; }
.aliasrow__text strong { font-weight: 500; }
.aliasrow__text span { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aliasrow__remove { display: grid; place-items: center; width: 26px; height: 26px; flex: none; border: 0; border-radius: 6px; background: none; color: var(--text-muted); transition: color 0.2s, background-color 0.2s; }
.aliasrow__remove:hover { color: #f06a6a; background: rgb(240 106 106 / 0.12); }

.avatar { display: grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 600; }
.avatar--small { width: 20px; height: 20px; font-size: 10.5px; }

.switch { display: inline-flex; align-items: center; gap: 9px; padding: 0; border: 0; background: none; flex: none; }
.switch__label { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; color: var(--text-muted); transition: color 0.25s; }
.switch__track { position: relative; width: 38px; height: 22px; border-radius: 11px; background: var(--track); transition: background-color 0.25s, box-shadow 0.25s; }
.switch__knob { position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / 0.4); transition: transform 0.28s var(--ease); }
.switch[aria-checked="true"] .switch__track { background: linear-gradient(90deg, var(--accent), var(--accent2)); box-shadow: 0 0 14px -1px var(--accent-glow); }
.switch[aria-checked="true"] .switch__knob { transform: translateX(16px); }
.switch[aria-checked="true"] .switch__label { color: var(--accent); }

/* ---------- A look into the game ---------- */

.view {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 12px;
  min-height: 520px; padding: 16px;
  border-radius: 14px; border: 1px solid var(--card-border);
  box-shadow: 0 60px 100px -50px rgb(0 0 0 / 0.9), 0 24px 50px -24px rgb(0 0 0 / 0.7);
}
.view::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, transparent 35%, rgb(0 0 0 / 0.5)); border-radius: inherit; box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.1); pointer-events: none; }
.view__scene { position: absolute; inset: -14% 0; z-index: -2; will-change: transform; }
.scene--mini .moon { right: 16%; top: 20%; width: 64px; }
.scene--dusk { --sky-low: color-mix(in srgb, var(--accent) 16%, hsl(var(--h) calc(var(--s) * 2) 24%)); }
/* Below the window: the chat on the left, the tooltip on the right. */
.view--band { flex-direction: row; align-items: flex-end; justify-content: space-between; gap: 20px; min-height: 300px; }
.view--band .chat { order: -1; flex: 0 1 620px; min-width: 0; }
.view__label { position: absolute; left: 14px; top: 14px; padding: 4px 10px; border-radius: 999px; background: rgb(0 0 0 / 0.4); border: 1px solid rgb(255 255 255 / 0.12); font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-dim); backdrop-filter: blur(6px); }

.tip { align-self: flex-end; display: grid; gap: 1px; min-width: 200px; padding: 9px 12px 10px; border-radius: 7px; background: hsl(var(--h) var(--s) 5% / 0.9); border: 1px solid rgb(255 255 255 / 0.22); box-shadow: 0 14px 34px rgb(0 0 0 / 0.5); font-size: 13px; line-height: 1.45; }
.tip strong { font-size: 14.5px; font-weight: 500; }
.tip__alias { display: flex; justify-content: space-between; gap: 24px; color: rgb(156 163 186); animation: come 0.4s var(--ease); }
.tip__alias b { font-weight: 400; color: #fff; }
@keyframes come { from { opacity: 0; transform: translateY(-4px); } }

.chat { border-radius: 9px; background: rgb(0 0 0 / 0.46); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); font-size: 13.5px; line-height: 1.5; }
.chat__tabs { display: flex; gap: 2px; padding: 5px 6px 0; }
.chat__tabs span { padding: 3px 10px 5px; border-radius: 6px 6px 0 0; font-size: 11.5px; color: rgb(255 255 255 / 0.45); }
.chat__tabs .is-active { background: rgb(255 255 255 / 0.08); color: rgb(255 255 255 / 0.85); }
.chat__lines { padding: 8px 12px 11px; border-top: 1px solid rgb(255 255 255 / 0.08); }
.chat__line { overflow-wrap: anywhere; }
.chat__line--guild { color: #62e879; }
.chat__line--party { color: #aab2ff; }
.chat__line--whisper { color: #ff8cf4; }
.chat__name { padding: 0 1px; border: 0; border-radius: 3px; background: none; color: inherit; font-weight: 500; cursor: default; }
.chat__name.is-changed { animation: changed 1.4s var(--ease); }
@keyframes changed { 0%, 35% { background: var(--accent-soft); color: var(--accent2); box-shadow: 0 0 0 2px var(--accent-soft); } }

/* ---------- The picture book ---------- */

.booktabs { display: flex; justify-content: center; gap: 4px; width: fit-content; margin: 0 auto; padding: 4px; border-radius: 12px; background: rgb(255 255 255 / 0.04); border: 1px solid var(--hairline); }
.booktabs button { padding: 7px 16px; border: 0; border-radius: 8px; background: none; font-size: 14px; font-weight: 500; color: var(--text-muted); transition: color 0.2s, background-color 0.2s; }
.booktabs button:hover { color: var(--text); }
.booktabs button[aria-selected="true"] { background: var(--card); color: var(--text); box-shadow: var(--sheen), 0 0 0 1px var(--card-border); }

/* The book and, beside it, the rail; the rail stays in view while the
   book scrolls past. */
.journal { display: grid; grid-template-columns: minmax(0, 1fr) 296px; gap: 36px; align-items: start; }
.rail { position: sticky; top: 92px; display: grid; gap: 10px; }

.bookfilter { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 28px; padding: 8px 8px 8px 16px; border-radius: 10px; background: var(--accent-soft); border: 1px solid var(--accent-line); font-size: 14px; color: var(--text); }
.bookfilter[hidden] { display: none; }

.chapter { margin-top: 44px; }
.chapter + .chapter { margin-top: 60px; }
/* The head in one line: day, zone, levels; a line on each side runs out. */
.chapter__head { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 16px; margin-bottom: 26px; }
.chapter__side { display: flex; align-items: center; gap: 14px; min-width: 0; }
.chapter__side i { flex: 1; min-width: 12px; height: 1px; background: linear-gradient(90deg, transparent, var(--accent-line)); }
.chapter__side i:last-child { transform: scaleX(-1); }
.chapter__day { font-size: 11.5px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-muted); }
.chapter__head h3 { font: 400 clamp(1.6rem, 3vw, 2.05rem)/1.1 var(--serif); letter-spacing: 0.005em; color: var(--accent2); }
.chapter__sub { font-size: 13px; color: var(--text-dim); white-space: nowrap; }

/* The line down the middle; the events hang on it left and right, each
   column running on by itself, so they interlock. */
.chapter__events { position: relative; display: flow-root; padding: 4px 0 2px; }
.chapter__events::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; margin-left: -1px; border-radius: 1px; background: linear-gradient(180deg, var(--accent-trail) 88%, transparent); }
.story { position: relative; width: calc(50% - 34px); margin-bottom: 14px; }
.story:nth-child(odd) { float: left; clear: left; }
.story:nth-child(even) { float: right; clear: right; }
.story:nth-child(2) { margin-top: 48px; }
.js .story.reveal:nth-child(odd) { transform: translate3d(-26px, 0, 0); }
.js .story.reveal:nth-child(even) { transform: translate3d(26px, 0, 0); }
.js .story.reveal.is-in { transform: none; }

.story__dot { position: absolute; top: 21px; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--window); border: 1px solid var(--accent-line); color: var(--accent); }
.story__dot::before { content: ""; position: absolute; top: 50%; width: 22px; height: 1px; background: var(--accent-trail); }
.story:nth-child(odd) .story__dot { right: -46px; }
.story:nth-child(odd) .story__dot::before { right: 100%; }
.story:nth-child(even) .story__dot { left: -46px; }
.story:nth-child(even) .story__dot::before { left: 100%; }
.story--death .story__dot { border-color: #5a4650; color: #c8a9b3; }
.story--boss .story__dot { border-color: rgb(242 169 59 / 0.5); color: #f2c36a; }
.story--plain .story__dot { border-color: var(--control-border); color: var(--text-dim); }

.story__card { position: relative; overflow: hidden; border-radius: 10px; background: var(--card); border: 1px solid var(--card-border); box-shadow: var(--sheen), 0 14px 34px -20px rgb(0 0 0 / 0.8); }
.story.is-big .story__card { border-color: var(--card-active); }
.story.is-big .story__card::before, .toast.is-big::before { content: ""; position: absolute; left: 0; top: 50%; width: 3px; height: 22px; margin-top: -11px; border-radius: 0 2px 2px 0; background: var(--accent); }
.story__body { display: flex; align-items: center; gap: 14px; padding: 12px 14px; }
.story.is-big .story__body { padding-block: 17px; }
.story__text { min-width: 0; }
.story__text h4 { font-size: 14.5px; font-weight: 500; letter-spacing: -0.005em; }
.story__text p { margin-top: 2px; font-size: 12.5px; color: var(--text-muted); }
.story--death h4 { color: #c8a9b3; }
/* A bundle lists every time below its line. */
.story__times { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; }
.story__times span { padding: 1px 6px; border-radius: 5px; background: var(--field); border: 1px solid var(--card-border); font-size: 11px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.story__foot { display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 14px; border-top: 1px solid var(--divider); background: rgb(0 0 0 / 0.16); font-size: 12.5px; color: var(--text-dim); }

/* The picture of an event: the same frame for every kind. */
.pic { position: relative; display: grid; place-items: center; width: 54px; height: 54px; flex: none; border: 1px solid; border-radius: 6px; }
.pic b { font: 400 25px/1 var(--serif); }
/* How many events a bundled card stands for, in the picture's corner. */
.pic__count { position: absolute; right: -7px; bottom: -7px; display: grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border: 1px solid; border-color: inherit; border-radius: 10px; background: inherit; font-size: 11px; font-weight: 600; font-style: normal; line-height: 1; }

/* ---------- The rail beside the book ---------- */

.rcard { position: relative; padding: 13px 16px 16px; border-radius: 10px; background: var(--card); border: 1px solid var(--card-border); box-shadow: var(--sheen); transition: border-color 0.3s; }
.rcard.is-picked { border-color: var(--card-active); }
.rcard__head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 10px; font-size: 11.5px; font-weight: 500; color: var(--text-muted); }
.rcard__head h4 { font: inherit; }
.rcard__stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 10px; }
.rstat p { display: flex; align-items: baseline; gap: 5px; }
.rstat b { font-size: 21px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.rstat em { font-size: 12.5px; font-weight: 500; font-style: normal; color: var(--accent); }
.rstat span { display: block; margin-top: 1px; font-size: 11.5px; line-height: 1.3; color: var(--text-muted); }
.rcard__hint { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--divider); font-size: 11.5px; line-height: 1.45; color: var(--text-muted); }

/* A person: a click shows only their events; the picked one glows. */
.person { position: relative; display: flex; align-items: center; gap: 10px; width: calc(100% + 16px); margin: 0 -8px; padding: 8px; border: 0; border-radius: 8px; background: none; text-align: left; transition: background-color 0.2s; }
.person + .person { margin-top: 2px; }
.person:hover { background-color: rgb(255 255 255 / 0.045); }
.person[aria-pressed="true"] { background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 22%, transparent), color-mix(in srgb, var(--accent) 4%, transparent)); }
.person[aria-pressed="true"]::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 2px; background: linear-gradient(var(--accent2), var(--accent)); box-shadow: 0 0 10px 1px var(--accent-glow); }
.person__text { display: grid; flex: 1; min-width: 0; }
.person__text strong { font-size: 13.5px; font-weight: 500; }
.person__text span, .person__end span { font-size: 11.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person__end { display: grid; justify-items: end; flex: none; }
.person__end span:first-child { font-size: 12px; color: var(--text-dim); }
.person__state { display: inline-flex; align-items: center; gap: 5px; }
.person__state::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--text-muted); opacity: 0.6; }
.person__state.is-online { color: var(--text-dim); }
.person__state.is-online::before { background: #62e879; opacity: 1; box-shadow: 0 0 7px rgb(98 232 121 / 0.6); }
.rcard--brief .person { margin-bottom: 10px; }

.rbar + .rbar { margin-top: 12px; }
.rbar p { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 6px; font-size: 12.5px; }
.rbar p span:last-child { font-size: 11.5px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.rbar__track { display: block; height: 4px; border-radius: 2px; background: var(--track); overflow: hidden; }
.rbar__track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent2)); }
.pic--accent { background: var(--accent-deep); border-color: var(--accent-line); color: var(--accent2); }
.pic--plain { background: var(--control); border-color: var(--control-border); color: var(--text-dim); }
.pic--death { background: #2a2226; border-color: #40333a; color: #c8a9b3; }
.pic--boss { background: #2e2416; border-color: rgb(242 169 59 / 0.5); color: #f2c36a; }

/* ---------- The fellow travellers ---------- */

/* As in Famulus/UI/Fellows.lua: the three closest as tiles, everyone else in
   a list, and a person's story as their card beside a book. */
.fellows__title { font-size: 12px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted); }
.fellows > .fellows__title { margin-bottom: 14px; }

.ftiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.ftile {
  position: relative; display: flex; flex-direction: column; align-items: center; min-width: 0;
  padding: 24px 16px 0; overflow: hidden; border-radius: 12px; text-align: center;
  background: var(--card); border: 1px solid var(--card-border);
  box-shadow: var(--sheen), 0 18px 40px -26px rgb(0 0 0 / 0.9);
  transition: border-color 0.25s, transform 0.25s var(--ease);
}
.ftile:hover { border-color: var(--card-active); transform: translateY(-2px); }
.ftile__rank { position: absolute; left: 16px; top: 13px; font: 400 18px/1 var(--serif); color: var(--text-muted); }
.ftile__name { max-width: 100%; margin-top: 12px; overflow: hidden; font: 400 21px/1.2 var(--serif); text-overflow: ellipsis; white-space: nowrap; }
.ftile__sub { margin-top: 3px; font-size: 12.5px; color: var(--text-muted); }
.ftile .badge { margin-top: 10px; }
.ftile__stats { margin: 11px 0 18px; font-size: 13px; font-weight: 500; color: var(--text-dim); }
/* The foot: in your group now, or when and where last. */
.ftile__foot { align-self: stretch; margin: auto -16px 0; padding: 8px 12px; border-top: 1px solid var(--divider); background: rgb(0 0 0 / 0.16); font-size: 12px; font-weight: 500; color: var(--text-muted); }
.ftile.is-now .ftile__foot, .frow.is-now .frow__last, .fprofile__status.is-now { color: var(--accent); }

/* The crest: the initial in the colour of the class, and around it the bond's
   ring, filled as far as the way to the next tier. */
.crest { --p: 0; --ring: 3px; position: relative; display: grid; place-items: center; flex: none; border-radius: 50%; background: conic-gradient(var(--accent) calc(var(--p) * 1turn), var(--track) 0); }
.crest::before { content: ""; position: absolute; inset: var(--ring); border-radius: 50%; background: radial-gradient(circle at 50% 28%, var(--control), var(--field)); }
.crest b { position: relative; font-family: var(--serif); font-weight: 400; line-height: 1; }
.crest--small { --ring: 2px; width: 38px; height: 38px; }
.crest--small b { font-size: 17px; }
.crest--big { width: 68px; height: 68px; }
.crest--big b { font-size: 30px; }
.crest--huge { --ring: 4px; width: 88px; height: 88px; }
.crest--huge b { font-size: 40px; }

/* The bond's name; in the accent from Trusted on. */
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--control-border); background: rgb(255 255 255 / 0.03); font-size: 11.5px; font-weight: 500; color: var(--text-muted); white-space: nowrap; }
.badge.is-high { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent); }

.fellows__bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 36px 0 12px; }
.fsort { height: 34px; padding: 0 8px; border-radius: 8px; background: var(--control); border: 1px solid var(--control-border); font-size: 13px; color: var(--text-dim); }

.flist { padding: 4px 6px 6px; border-radius: 12px; background: var(--card); border: 1px solid var(--card-border); box-shadow: var(--sheen); }
.flist__heads, .frow { display: grid; grid-template-columns: 38px minmax(0, 1fr) 150px 130px 110px; align-items: center; gap: 0 14px; }
.flist__heads { padding: 10px 10px 8px; font-size: 10.5px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); }
.flist__heads .flist__name { grid-column: 1 / 3; }
.frow { width: 100%; padding: 8px 10px; border: 0; border-top: 1px solid var(--divider); background: none; text-align: left; transition: background-color 0.2s; }
.frow:hover { background-color: rgb(255 255 255 / 0.045); }
.frow__name { display: grid; min-width: 0; }
.frow__name strong { font-size: 14px; font-weight: 500; }
.frow__name span { overflow: hidden; font-size: 12px; color: var(--text-muted); text-overflow: ellipsis; white-space: nowrap; }
.frow .badge { justify-self: start; }
.frow__time { font-size: 13px; font-weight: 500; color: var(--text-dim); }
.frow__last { font-size: 13px; color: var(--text-muted); }

/* A person's story: the way back, the card, and the book of your days. */
.fellows__back { display: inline-flex; align-items: center; gap: 6px; height: 34px; margin-bottom: 22px; padding: 0 14px 0 8px; border-radius: 8px; border: 1px solid var(--control-border); background: rgb(255 255 255 / 0.03); font-size: 13.5px; font-weight: 500; color: var(--text-dim); transition: color 0.2s, background-color 0.2s; }
.fellows__back:hover { color: var(--text); background-color: rgb(255 255 255 / 0.07); }
.fellows__back .icon { transform: rotate(90deg); }
.fstory { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 36px; align-items: start; }
.fstory__book .chapter:first-child { margin-top: 0; }
.fprofile {
  position: sticky; top: 92px; display: flex; flex-direction: column; align-items: center;
  padding: 26px 20px 20px; border-radius: 12px; text-align: center;
  background: var(--card); border: 1px solid var(--card-border);
  box-shadow: var(--sheen), 0 18px 40px -26px rgb(0 0 0 / 0.9);
}
.fprofile__name { margin-top: 12px; font: 400 26px/1.15 var(--serif); }
.fprofile__sub { margin-top: 4px; font-size: 13px; color: var(--text-muted); }
.fprofile__status { margin-top: 6px; font-size: 13px; font-weight: 500; color: var(--text-muted); }
.fprofile__next { margin-top: 8px; font-size: 12px; color: var(--text-muted); }
.fprofile__cells { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr) minmax(0, 1fr); width: 100%; margin-top: 18px; padding: 14px 0; border-block: 1px solid var(--divider); }
.fprofile__cells div { display: grid; gap: 3px; }
.fprofile__cells b { font-size: 15px; font-weight: 600; }
.fprofile__cells span { font-size: 11.5px; color: var(--text-muted); }
.fprofile__first { margin-top: 14px; font-size: 13px; color: var(--text-dim); }
.fprofile__buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 18px; }

/* The bond's four steps on a line, the current one glowing. */
.ladder { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%; margin-top: 18px; }
.ladder li { position: relative; padding-top: 17px; font-size: 10.5px; line-height: 1.3; color: var(--text-muted); hyphens: auto; }
.ladder li::before { content: ""; position: absolute; z-index: 1; left: 50%; top: 0; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: var(--track); }
.ladder li + li::after { content: ""; position: absolute; left: -50%; top: 4px; width: 100%; height: 2px; background: var(--track); }
.ladder li.is-done::before, .ladder li.is-done::after, .ladder li.is-here::after { background: var(--accent-line); }
.ladder li.is-here { font-weight: 600; color: var(--accent); }
.ladder li.is-here::before { background: var(--accent); box-shadow: 0 0 10px 2px var(--accent-glow); }

/* ---------- The live feed ---------- */

.toasts { position: relative; height: 212px; }
.toast {
  position: absolute; left: 0; top: 0; overflow: hidden;
  display: flex; align-items: center; gap: 14px;
  width: max-content; min-width: 230px; max-width: 100%; height: 64px; padding: 0 22px 0 14px;
  border-radius: 10px; background: var(--card); border: 1px solid var(--card-border);
  background-image: linear-gradient(180deg, transparent 30%, rgb(0 0 0 / 0.22));
  box-shadow: var(--sheen), 0 18px 44px -14px rgb(0 0 0 / 0.85);
  opacity: 0; transform: translateY(calc(var(--slot, 0) * 74px - 12px));
  transition: transform 0.5s var(--ease), opacity 0.3s;
}
.toast.is-in { opacity: 1; transform: translateY(calc(var(--slot, 0) * 74px)); }
.toast.is-leaving { opacity: 0; transition-duration: 0.5s; }
.toast.is-big { border-color: var(--card-active); }
.toast .pic { width: 48px; height: 48px; border-width: 2px; border-radius: 8px; }
.toast .pic b { font-size: 22px; }
.toast__text { display: grid; min-width: 0; }
.toast__text strong { font-size: 14.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toast__text span { font-size: 12.5px; color: var(--text-muted); }

.view--wide { display: block; min-height: 0; aspect-ratio: 16 / 8.4; padding: 0; }
.view--wide .view__label { top: auto; bottom: 14px; }
.hud i { position: absolute; border: 1px solid rgb(255 255 255 / 0.13); background: rgb(0 0 0 / 0.2); }
.hud__unit { left: 3%; top: 6%; width: 17%; height: 10%; border-radius: 8px; }
.hud__map { right: 3%; top: 6%; width: 11%; aspect-ratio: 1; border-radius: 50%; }
.hud__bar { position: absolute; left: 50%; bottom: 5%; display: flex; gap: 5px; transform: translateX(-50%); }
.hud__bar i { position: static; width: clamp(16px, 3.2vw, 34px); aspect-ratio: 1; border-radius: 6px; }
.feedspot { position: absolute; left: 50%; top: 9%; width: min(330px, 86%); transform: translateX(-50%); }
.feedspot__mover { display: grid; place-items: center; height: 64px; margin-bottom: 10px; padding: 0 14px; border-radius: 10px; border: 1px dashed var(--accent-line); background: var(--accent-soft); color: var(--accent2); font-size: 12.5px; text-align: center; line-height: 1.3; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.feedspot__mover:active { cursor: grabbing; }
.feedspot__mover[hidden] { display: none; }

.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 22px; }
.chips__label { margin-right: 6px; font-size: 14px; color: var(--text-muted); }
.chip { height: 34px; padding: 0 14px; border-radius: 999px; background: var(--card); border: 1px solid var(--card-border); box-shadow: var(--sheen); font-size: 13.5px; font-weight: 500; color: var(--text-dim); transition: color 0.2s, border-color 0.2s, transform 0.2s var(--ease); }
.chip:hover { color: var(--text); border-color: var(--control-border); transform: translateY(-1px); }
.chip:active { transform: translateY(0); }
.chip--ghost { margin-left: auto; background: none; box-shadow: none; }
.chip--ghost[aria-pressed="true"] { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }

/* ---------- Installation ---------- */

/* The page ends as it began: the sky comes up out of the ground of the page. */
.section--last { padding-bottom: clamp(300px, 42vw, 540px); }
.scene--foot {
  inset: auto 0 0 0; height: clamp(460px, 68vw, 860px); z-index: -1;
  background: linear-gradient(180deg, transparent, var(--sky-mid) 24%, hsl(var(--h) calc(var(--s) * 2) 22%) 52%);
}
.scene--foot .scene__glow { position: absolute; inset: 0; background: radial-gradient(50% 40% at 50% 62%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 72%); }
.scene--foot .scene__embers { position: absolute; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.steps li { padding-top: 22px; border-top: 1px solid var(--hairline); }
.steps__num { display: grid; place-items: center; width: 34px; height: 34px; margin-bottom: 18px; border-radius: 50%; border: 1px solid var(--accent-line); background: var(--accent-soft); color: var(--accent2); font-size: 14px; font-weight: 600; }
code { padding: 1px 6px; border-radius: 5px; background: rgb(255 255 255 / 0.07); border: 1px solid var(--hairline); font: 0.88em var(--mono); color: var(--accent2); overflow-wrap: anywhere; }

.release { display: flex; align-items: center; gap: 22px; margin-top: clamp(48px, 7vw, 80px); padding: 24px 28px; border-radius: 16px; background: hsl(var(--h) var(--s) 9% / 0.78); border: 1px solid var(--card-active); box-shadow: var(--sheen), 0 40px 90px -40px rgb(0 0 0 / 0.9), 0 0 80px -30px var(--accent-glow); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.release img { flex: none; }
.release h3 { font-size: 19px; font-weight: 600; letter-spacing: -0.02em; }
.release p { margin-top: 4px; font-size: 14.5px; color: var(--text-dim); }
.release .btn { margin-left: auto; }

/* ---------- Footer ---------- */

.footer { position: relative; padding: 8px 0 44px; background: var(--bg); }
.footer__inner { display: flex; align-items: flex-start; justify-content: space-between; gap: 40px; padding-top: 28px; border-top: 1px solid var(--hairline); }
.footer__brand { display: flex; align-items: center; gap: 9px; flex: none; }
.footer__brand strong { font-weight: 600; letter-spacing: -0.02em; }
.footer__brand span { font-size: 13px; color: var(--text-muted); }
.footer__legal { max-width: 62ch; font-size: 12.5px; line-height: 1.6; color: var(--text-muted); text-align: right; }

/* ---------- Smaller screens ---------- */

@media (max-width: 1400px) {
  /* No room beside the window: the cards stay on it. */
  .shot__feed { right: 16px; width: min(400px, 46%); }
}

@media (max-width: 1080px) {
  /* The addon's own pages keep only their icons. */
  .fwin__area--page { padding: 0 9px; }
  .fwin__area--page > span { display: none; }
}

@media (max-width: 900px) {
  /* One column: the head, then the chosen feature with its sections side by
     side, then the content. (Up to 900px: with the sidebar beside it, the
     English head would be wider than the window.) */
  .fwin { grid-template-columns: minmax(0, 1fr); grid-template-rows: var(--head) auto minmax(0, 1fr); min-height: 0; }
  .fwin__brand { display: none; }
  .fwin__top { padding-inline: 8px; border-bottom: 1px solid var(--divider); }
  .fwin__side { padding: 16px 16px 12px; border-bottom: 1px solid var(--divider); }
  .fwin__search, .fwin__count { display: none; }
  .fwin__about { padding: 0 0 12px; }
  .fwin__tabs { grid-auto-flow: column; justify-content: start; }
  .fwin__main { padding: 18px 16px; border: 0; }
}

@media (max-width: 680px) {
  /* Only the chosen feature keeps its name; the others show their icon.
     Below this width the head would be wider than the window. */
  .fwin__area:not(.is-active) > span, .fwin__area:not(.is-active) b { display: none; }
  .fwin__area--page { display: none; }
  .fwin__close { margin-left: auto; }
}

@media (max-width: 560px) {
  .aliasform { grid-template-columns: minmax(0, 1fr) auto; }
  .aliasform input:first-child { grid-column: 1 / -1; }
  /* The chapter head stacks: day, zone, levels. */
  .chapter__head { grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 3px; text-align: center; }
  .chapter__side i { display: none; }
}

@media (max-width: 980px) {
  .nav__links { display: none; }
  .hero__inner { grid-template-columns: minmax(0, 1fr); }
  .shot { margin-top: -40px; }
  .hero__shade { background: linear-gradient(180deg, hsl(var(--h) calc(var(--s) * 1.6) 4% / 0.5), transparent 70%); }
  /* The camp gets room of its own below the text, so that the moon does
     not shine through the buttons; main.js pans it into view. */
  .hero__inner { padding-bottom: 300px; }
  .hero .ridge { left: var(--pan-left, -4%); width: var(--pan-width, 108%); height: min(72%, 620px); }
  .view { min-height: 440px; }
  .view--band { min-height: 300px; }
  /* A person's card stands above your story. */
  .fstory { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .fprofile { position: static; width: 100%; max-width: 420px; margin-inline: auto; }
  /* The rail moves between the tabs and the book, its cards side by side. */
  .journal { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .journal__book { display: contents; }
  .rail { order: 1; position: static; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); align-items: start; margin-top: 24px; }
  .bookfilter { order: 2; }
  .book { order: 3; }
}

@media (max-width: 760px) {
  .wrap { width: min(var(--wrap), 100% - 36px); }
  .shot { width: calc(100% - 36px); }
  .shot__feed { display: none; }
  .nav { padding-inline: 18px; gap: 12px; }
  .points, .steps { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .scene--mini .moon { display: none; }
  .hero .ridge { height: 520px; }
  .hero__facts { gap: 4px 18px; }
  .hero__facts li + li::before { content: none; }
  .view--band { flex-direction: column; align-items: stretch; min-height: 400px; }
  .view--band .chat { order: 0; flex: none; }
  .view--band .tip { align-self: flex-end; }
  .view--wide { aspect-ratio: auto; height: 400px; }
  .view--wide .view__label { display: none; }
  .hud__unit { width: 30%; height: 8%; }
  .hud__map { width: 20%; }
  .feedspot { top: 22%; width: min(360px, 94%); }
  .toast { padding-right: 16px; }
  .chip--ghost { margin-left: 0; }
  .release { flex-direction: column; align-items: flex-start; }
  .release .btn { margin-left: 0; }
  .footer__inner { flex-direction: column; gap: 18px; }
  .footer__legal { text-align: left; }

  /* The closest three one below the other, each as a row: crest, then name. */
  .ftiles { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .ftile { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 16px; align-items: center; justify-items: start; padding: 16px 16px 0; text-align: left; }
  .ftile .crest { grid-row: 1 / span 3; }
  .ftile__rank { left: auto; right: 16px; }
  .ftile__name { margin-top: 0; font-size: 19px; }
  .ftile .badge { margin-top: 6px; }
  .ftile__stats, .ftile__foot { grid-column: 1 / -1; }
  .ftile__stats { margin: 12px 0; }
  .ftile__foot { justify-self: stretch; text-align: center; }
  /* The list keeps the crest (it shows the bond), name and when. */
  .flist__heads, .frow { grid-template-columns: 38px minmax(0, 1fr) auto; }
  .frow .badge, .frow__time, .flist__bond, .flist__time { display: none; }

  /* The book in one column: the line on the left, every event to its right. */
  .chapter__events::before { left: 15px; }
  .story, .story:nth-child(odd), .story:nth-child(even) { float: none; width: auto; margin: 0 0 12px 46px; }
  .story:nth-child(odd) .story__dot, .story:nth-child(even) .story__dot { left: -43px; right: auto; }
  .story:nth-child(odd) .story__dot::before, .story:nth-child(even) .story__dot::before { left: 100%; right: auto; width: 19px; }
  .js .story.reveal:nth-child(odd), .js .story.reveal:nth-child(even) { transform: translate3d(0, 18px, 0); }
  .js .story.reveal.is-in:nth-child(n) { transform: none; }
}

@media (max-width: 420px) {
  .nav .btn { display: none; }
}

/* Whoever asks for less motion gets a still page. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal, .js .story.reveal:nth-child(n) { opacity: 1; transform: none; }
  .scene__embers { display: none; }
}
