/* Perfect World Lodge — the public page.
 *
 * THE PALETTE IS TAKEN FROM THE LOGO, not invented: the dragon's emerald glow, the gold of the
 * wordmark, and the near-black green it sits on. The page should look like it belongs to that
 * mark rather than merely containing it.
 *
 * NO PWI BRANDING ANYWHERE, and no game art from the client packs. The loading screens, login
 * plates and UI art in surfaces.pck are Wanmei's, and this site is not the place for them. What
 * carries the look instead is type, spacing, ornament and colour - all CSS, nothing generated.
 *
 * No webfonts and no remote anything: the CSP forbids it, and a landing page that waits on a
 * font CDN to render is slower than one that does not.
 */

:root {
  /* From the logo, sampled. */
  --bg:        #070c0a;   /* the near-black green the mark sits on */
  --bg-lift:   #0b1310;
  --raised:    #0e1815;
  --line:      #1c2b25;
  --line-lit:  #2c463c;

  --text:      #e7ece9;
  --muted:     #8ba099;

  --emerald:   #35d6a0;   /* the dragon's glow */
  --emerald-d: #1d8f6a;
  --gold:      #e0cd96;   /* the wordmark */
  --gold-d:    #a8905a;

  --bad:       #d4626a;

  --radius: 4px;          /* deliberately tight - soft corners read as SaaS, not as a game */
  --wide:   1080px;

  /* Display face. A serif carries the fantasy register far better than a grotesque, and these
     ship on every platform, so it costs nothing and waits for nothing. */
  --display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* SWAPPING THE ART. The hero cycles the four files in site/art/. To use your own - a
     screenshot from this server, or commissioned work - drop it in there and point one of the
     .hero-slide rules at it. Crop to roughly 16:9 and darken it; the scrim assumes art that is
     already dim, and a bright image will fight the text rather than sit behind it. */
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.7 var(--body);
  -webkit-font-smoothing: antialiased;
}

/* Anything the script decides not to show. Set here rather than inline, because the CSP has no
   unsafe-inline for styles. */
.hidden { display: none !important; }

a { color: var(--emerald); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.2; margin: 0 0 .6rem; }
h1 { font-size: clamp(2.6rem, 7vw, 4.2rem); letter-spacing: -.01em; color: var(--gold); }
h2 { font-size: clamp(1.5rem, 3vw, 1.9rem); color: var(--gold); }
h3 { font-size: 1.08rem; color: var(--text); letter-spacing: .01em; }
p  { margin: 0 0 1rem; }

/* ── bars ─────────────────────────────────────────────────────────────────── */
.bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  padding: .75rem clamp(1rem, 4vw, 2rem);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--bg-lift), var(--bg));
}
.bar.foot {
  border-bottom: 0; border-top: 1px solid var(--line);
  color: var(--muted); font-size: .88rem; margin-top: 3rem;
}
.quiet { color: var(--muted); }

.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--gold); font-weight: 600; }
.brand:hover { text-decoration: none; color: var(--text); }
.brand .name { font-family: var(--display); font-size: 1.05rem; letter-spacing: .02em; }
.brand img { width: 32px; height: 32px; display: block; }

nav { display: flex; gap: 1.4rem; flex-wrap: wrap; }
nav a {
  color: var(--muted); font-size: .8rem;
  text-transform: uppercase; letter-spacing: .12em;
}
nav a:hover { color: var(--emerald); text-decoration: none; }

/* ── layout ───────────────────────────────────────────────────────────────── */
main { max-width: var(--wide); margin: 0 auto; padding: 0 clamp(1rem, 4vw, 2rem); }

/* ── hero ─────────────────────────────────────────────────────────────────── */
/* Four layers of the game's own concept art, cross-fading with a slow drift.
 *
 * WHERE THE ART COMES FROM. The client's original loading screens, out of
 * `surfaces.pck.pwi-orig` - the backup our rebrand tooling left behind. Every one of them
 * shipped with the publisher's mark top-left and the loading-bar chrome along the bottom, so
 * each is CROPPED to the landscape only: no wordmark, no logo, no UI furniture. They are also
 * pre-darkened and desaturated at build time, which is why they total under 200 KB for four
 * full-width backgrounds.
 *
 * WHY CSS AND NOT JAVASCRIPT. The page needs no script to look finished; the art runs on the
 * compositor, costs no main thread, and keeps working if auth.js never loads.
 */
/* The hero sits OUTSIDE <main>, so it is not bound by the content column's max-width and the
   art runs edge to edge. Its words get their own centred block instead.

   Tall enough to be the whole first impression: most of the viewport, but capped so it does not
   become an absurd letterbox on an ultrawide, and floored so it never crushes on a short laptop
   screen where the text still has to fit. */
.hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: grid;
  place-items: center;
  min-height: clamp(560px, 82vh, 900px);
  padding: clamp(2.5rem, 6vw, 4rem) 0;
  text-align: center;
}

.hero-inner {
  max-width: 42rem;
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2rem);
}

.hero-art { position: absolute; inset: 0; z-index: 0; }

.hero-slide {
  position: absolute; inset: 0;
  background-size: cover; background-position: center 40%;
  opacity: 0;
  animation: heroFade 64s ease-in-out infinite;
  will-change: opacity, transform;
}
.hero-slide:nth-child(1) { background-image: url("art/pagoda.jpg");   animation-delay:  0s; }
.hero-slide:nth-child(2) { background-image: url("art/lotus.jpg");    animation-delay: 16s; }
.hero-slide:nth-child(3) { background-image: url("art/lanterns.jpg"); animation-delay: 32s; }
.hero-slide:nth-child(4) { background-image: url("art/valley.jpg");   animation-delay: 48s; }

/* Each slide holds for a quarter of the cycle and fades across the seam. The scale keeps
   drifting after it goes transparent and snaps back unseen, which is what makes a four-slide
   loop need only one keyframe set. */
@keyframes heroFade {
  0%   { opacity: 0; transform: scale(1.04); }
  3%   { opacity: 1; }
  22%  { opacity: 1; }
  25%  { opacity: 0; transform: scale(1.12); }
  100% { opacity: 0; transform: scale(1.04); }
}

/* The scrim sits BETWEEN the art and the words, not on the art itself - so the text keeps its
   contrast while the picture underneath changes brightness from one slide to the next. The
   emerald aura echoes the lightning in the mark. */
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(ellipse 60% 55% at 50% 38%, rgba(53, 214, 160, .16), transparent 70%),
    linear-gradient(180deg, rgba(7, 12, 10, .38) 0%, rgba(7, 12, 10, .55) 58%, var(--bg) 97%);
}

/* Everything the reader actually reads goes above both. */
.hero-inner { position: relative; z-index: 2; }

/* Motion is decoration here, and decoration is the first thing to drop: one still frame, no
   animation, no drift. The page loses nothing it needed. */
@media (prefers-reduced-motion: reduce) {
  .hero-slide { animation: none; }
  .hero-slide:nth-child(1) { opacity: 1; }
}

.crest { width: clamp(150px, 26vw, 230px); height: auto; margin: 0 auto .5rem; display: block; }

.kicker {
  color: var(--emerald); text-transform: uppercase;
  letter-spacing: .32em; font-size: .7rem; margin-bottom: .9rem;
}

.lede {
  color: var(--muted); font-size: 1.08rem;
  max-width: 34rem; margin: 0 auto 1.8rem;
}

/* ── ornamental rule ──────────────────────────────────────────────────────── */
/* A line that thins to nothing at both ends with a diamond at its centre. Pure CSS, and it does
   more to make a page feel like a game's than any amount of texture would. */
.rule { position: relative; height: 1px; margin: 2.6rem 0; border: 0;
        background: linear-gradient(90deg, transparent, var(--line-lit) 25%, var(--line-lit) 75%, transparent); }
.rule::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 7px; height: 7px; margin: -4px 0 0 -4px;
  background: var(--emerald-d); transform: rotate(45deg);
  box-shadow: 0 0 0 3px var(--bg);
}

.panel { padding: clamp(1.5rem, 4vw, 2.2rem) 0; }
.panel > h2 { text-align: center; margin-bottom: 1.8rem; }

.grid { display: grid; gap: 1.8rem; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.grid p { color: var(--muted); margin: 0; font-size: .95rem; }
.grid h3::before {
  content: ""; display: block; width: 26px; height: 2px;
  background: var(--emerald-d); margin-bottom: .7rem;
}

/* ── status pill ──────────────────────────────────────────────────────────── */
.status {
  display: inline-flex; align-items: center; gap: .6rem;
  padding: .4rem .9rem; margin: 0 0 1.6rem;
  border: 1px solid var(--line-lit); border-radius: 999px;
  background: rgba(14, 24, 21, .8); color: var(--muted);
  font-size: .82rem; text-transform: uppercase; letter-spacing: .08em;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); flex: none; }
.status.up { color: var(--text); border-color: var(--emerald-d); }
.status.up .dot { background: var(--emerald); box-shadow: 0 0 8px var(--emerald); }
.status.down .dot { background: var(--bad); }

/* ── buttons ──────────────────────────────────────────────────────────────── */
.actions { display: flex; gap: .75rem; flex-wrap: wrap; margin: 0; justify-content: center; }
.btn {
  display: inline-block; padding: .68rem 1.5rem;
  border: 1px solid var(--line-lit); border-radius: var(--radius);
  background: linear-gradient(180deg, var(--raised), var(--bg-lift));
  color: var(--text); font: inherit; font-size: .88rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .1em; cursor: pointer;
}
.btn:hover { border-color: var(--emerald-d); color: var(--emerald); text-decoration: none; }
.btn.primary {
  background: linear-gradient(180deg, var(--emerald), var(--emerald-d));
  border-color: var(--emerald); color: #04120d;
}
.btn.primary:hover { filter: brightness(1.12); color: #04120d; }
.btn.ghost { background: transparent; }
.btn[disabled] { opacity: .5; cursor: default; filter: none; }

/* ── steps ────────────────────────────────────────────────────────────────── */
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: 1.8rem;
         grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.steps li { position: relative; padding-left: 3rem; }
.steps li::before {
  counter-increment: step; content: "";
  position: absolute; left: 0; top: -.2rem;
  width: 2.1rem; height: 2.1rem;
  border: 1px solid var(--line-lit);
  background: var(--raised);
  transform: rotate(45deg);
}
.steps li::after {                     /* un-rotate the numeral inside the diamond */
  content: counter(step);
  position: absolute; left: 0; top: -.2rem;
  display: grid; place-items: center; width: 2.1rem; height: 2.1rem;
  color: var(--gold); font-family: var(--display); font-size: .95rem;
}
.steps p { color: var(--muted); margin: 0; font-size: .95rem; }

.linux-notes { margin-top: 2rem; padding: 1.1rem 1.25rem; border: 1px solid var(--line);
               border-radius: var(--radius); }
.linux-notes h3 { margin: 0 0 .5rem; }
.linux-notes p, .linux-notes li { color: var(--muted); font-size: .92rem; }
.linux-notes ul { margin: .5rem 0; padding-left: 1.2rem; }
.linux-notes code { font-size: .88em; overflow-wrap: anywhere; }

/* ── cards ────────────────────────────────────────────────────────────────── */
.join { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        align-items: start; }
.card {
  position: relative; padding: 1.8rem;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(180deg, var(--raised), var(--bg-lift));
}
/* Corner accents, the way a game UI frames a panel. */
.card::before, .card::after {
  content: ""; position: absolute; width: 10px; height: 10px; border: 1px solid var(--emerald-d);
}
.card::before { top: -1px; left: -1px; border-width: 1px 0 0 1px; }
.card::after  { bottom: -1px; right: -1px; border-width: 0 1px 1px 0; }
.card p { color: var(--muted); font-size: .95rem; }
.card > h3 { color: var(--gold); font-size: 1.15rem; margin-bottom: 1rem; }

label { display: block; margin: 1rem 0 .35rem; font-size: .76rem; font-weight: 600;
        text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
input {
  width: 100%; padding: .65rem .75rem;
  border: 1px solid var(--line-lit); border-radius: var(--radius);
  background: #060a09; color: var(--text); font: inherit;
}
input:focus { outline: none; border-color: var(--emerald); box-shadow: 0 0 0 3px rgba(53, 214, 160, .13); }
.hint { margin: .4rem 0 0; font-size: .8rem; color: var(--muted); }
.fineprint { margin: 1.2rem 0 0; font-size: .8rem; color: var(--muted); line-height: 1.6; }

form .btn { margin-top: 1.4rem; width: 100%; }

/* Empty by default so it takes no space until there is something to say. */
.msg { margin: 1rem 0 0; font-size: .9rem; }
.msg.err { color: var(--bad); }
.msg.ok  { color: var(--emerald); }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ── the register / sign-in / account pages ───────────────────────────────── */
/* These are forms, not a brochure: a narrow column reads better and stops a single input
   stretching to a thousand pixels on a desktop. */
main.narrow { max-width: 620px; padding-top: 2.5rem; padding-bottom: 2rem; }

.page-head { margin-bottom: 1.8rem; }
.page-head h1 { font-size: clamp(1.9rem, 5vw, 2.6rem); }
.page-head .lede { margin-left: 0; margin-right: 0; max-width: none; font-size: 1rem; }

.stack { display: grid; gap: 1.5rem; }

/* The hero centres its buttons; a form's do not belong centred under a left-aligned label. */
.actions.left { justify-content: flex-start; }

/* A button that should read as a link - "sign out" is not a call to action. */
.linkish {
  background: none; border: 0; padding: 0;
  color: var(--emerald); font: inherit; cursor: pointer;
}
.linkish:hover { text-decoration: underline; }

.chars { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.chars li {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  padding: .7rem .9rem;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: #060a09;
}
.char-name { font-family: var(--display); color: var(--gold); font-size: 1.05rem; }

/* The stats sit as a row of label/value pairs. Wrapping rather than scrolling, because a phone
   is where someone is most likely to be checking a character between other things. */
.char-meta { display: flex; gap: 1.3rem; flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; line-height: 1.25; }
.stat-label {
  color: var(--muted); font-size: .64rem;
  text-transform: uppercase; letter-spacing: .12em;
}
.stat-value { color: var(--text); font-family: var(--display); font-size: 1.05rem; white-space: nowrap; }

/* Name on top, class and gender beneath - the order the in-game character card uses. */
.char-head { display: flex; flex-direction: column; gap: .1rem; }
.char-sub {
  color: var(--muted); font-size: .72rem;
  text-transform: uppercase; letter-spacing: .1em;
}
/* Cultivation is a phrase, not a number, so it must not be forced onto one line. */
.stat:last-child .stat-value { white-space: normal; }


/* ── the form pages ───────────────────────────────────────────────────────── */
/* One still frame rather than the hero's slideshow. These are pages someone reads and types
   into, and art that moves while you are entering a password is art getting in the way.
   Fixed, so it does not slide under the form as the page scrolls. */
.page::before {
  content: ""; position: fixed; inset: 0; z-index: -2;
  background: url("art/valley.jpg") center / cover no-repeat;
  opacity: .8;
}
/* The same scrim idea as the hero: darken between the picture and the words, not on top of
   both, so the form keeps full contrast whatever is behind it. */
.page::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(ellipse 70% 50% at 50% 0%, rgba(53, 214, 160, .10), transparent 70%),
    linear-gradient(180deg, rgba(7, 12, 10, .45) 0%, rgba(7, 12, 10, .70) 50%, var(--bg) 92%);
}
/* The bars sit over the backdrop, so their own gradient has to stop hiding it. */
.page .bar { background: rgba(11, 19, 16, .72); backdrop-filter: blur(6px); }
.page .bar.foot { margin-top: 3rem; }

/* ── form controls beyond the plain input ─────────────────────────────────── */
select, textarea {
  width: 100%; padding: .65rem .75rem;
  border: 1px solid var(--line-lit); border-radius: var(--radius);
  background: #060a09; color: var(--text); font: inherit;
}
select:focus, textarea:focus {
  outline: none; border-color: var(--emerald);
  box-shadow: 0 0 0 3px rgba(53, 214, 160, .13);
}
textarea { resize: vertical; min-height: 5rem; }

/* ── support tickets ──────────────────────────────────────────────────────── */

.tickets { list-style: none; padding: 0; margin: 0 0 1.2rem; display: grid; gap: .5rem; }
.tickets li { border: 1px solid var(--line); border-radius: var(--radius); background: #060a09; }

/* The whole row is the control, so a thread opens wherever you click it. */
.ticket-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; width: 100%; padding: .7rem .9rem;
  background: none; border: 0; cursor: pointer;
  color: var(--text); font: inherit; text-align: left;
}
.ticket-head:hover .ticket-subject { color: var(--emerald); }
.ticket-subject { font-family: var(--display); font-size: 1rem; }

.ticket-status {
  flex: none; padding: .2rem .55rem; border-radius: 999px;
  border: 1px solid var(--line-lit);
  font-size: .64rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted);
}
/* Only the one that needs the PLAYER's attention is coloured. If every state glows, none of
   them means anything. */
.ticket-status.s-answered { color: var(--emerald); border-color: var(--emerald-d); }
.ticket-status.s-closed { opacity: .6; }

.ticket-body { padding: 0 .9rem .9rem; border-top: 1px solid var(--line); }

.thread { display: grid; gap: .9rem; margin: .9rem 0; }
.msg-row { padding: .7rem .85rem; border-radius: var(--radius); background: var(--raised); }
/* Staff replies get the accent edge, so a thread can be skimmed for the answer. */
.msg-row.from-staff { border-left: 2px solid var(--emerald-d); }
.msg-row.from-player { border-left: 2px solid var(--line-lit); }
.msg-who {
  display: flex; justify-content: space-between; gap: 1rem; margin-bottom: .35rem;
  font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted);
}
.msg-when { text-transform: none; letter-spacing: 0; }
/* pre-wrap, because a player's line breaks are part of what they wrote - and because the text
   is inserted with textContent, never as markup. */
.msg-body { white-space: pre-wrap; font-size: .93rem; }

.reply-form { display: grid; gap: .6rem; }
.reply-form .btn { margin-top: 0; justify-self: start; width: auto; }

/* ── faction logo ─────────────────────────────────────────────────────────
   A logo is 16x16 in game. Previews are hard-edged at every scale: a blurred zoom would show
   the leader a softer logo than the one players will get. */
.logo-faction + .logo-faction { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.logo-px { image-rendering: pixelated; image-rendering: crisp-edges; display: block; }
.logo-px.zoom { width: 128px; height: 128px; border: 1px solid var(--line);
  background: repeating-conic-gradient(#1a1a1a 0 25%, #262626 0 50%) 0 0 / 16px 16px; }
.logo-preview { display: flex; gap: 1.25rem; align-items: center; margin: .5rem 0 1rem; flex-wrap: wrap; }
.logo-side { display: flex; flex-direction: column; gap: .75rem; }
.logo-tag { display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .6rem;
  background: rgba(0, 0, 0, .55); border-radius: var(--radius); color: #f2f2c8; font-size: .85rem; }
.logo-real { display: flex; align-items: center; gap: .5rem; }
.logo-real .logo-px { outline: 1px solid var(--line); }
.logo-form { margin-top: 1rem; }
.logo-form input[type="file"] { display: block; margin: .4rem 0 .6rem; color: var(--muted); }
.logo-form .check { display: flex; align-items: center; gap: .5rem; font-size: .9rem; color: var(--muted);
  text-transform: none; letter-spacing: normal; margin: 0 0 .6rem; }
.logo-form .check input { width: auto; margin: 0; flex: none; }
.logo-faction .kicker { margin: 1.25rem 0 .35rem; }

/* ── factions roster ─────────────────────────────────────────────────────── */
.faction-tools { margin-bottom: 1.25rem; }
.faction-tools input { margin-bottom: .5rem; }
a.card.faction-link { display: flex; align-items: center; gap: .9rem; padding: 1.1rem 1.4rem;
  color: inherit; text-decoration: none; margin-bottom: 1rem; }
a.card.faction-link:hover { border-color: var(--emerald-d); }
a.card.faction-link:hover .faction-name { text-decoration: underline; }
a.card.faction-link.hidden { display: none; }
.faction-go { margin-left: auto; color: var(--muted); font-size: 1.6rem; line-height: 1; }
.faction-card { padding: 0 0 .6rem; }
.faction-top { display: flex; align-items: center; gap: 1rem; padding: 1.2rem 1.4rem 1rem; }
.faction-logo { width: 32px; height: 32px; flex: none; outline: 1px solid var(--line); }
.faction-logo.big { width: 64px; height: 64px; }
.faction-title { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.faction-name { color: var(--gold); font-family: var(--display); font-size: 1.2rem; overflow-wrap: anywhere; }
table.roster { width: 100%; border-collapse: collapse; font-size: .92rem; margin: 0 0 .6rem; }
table.roster th { text-align: left; font-weight: 600; color: var(--muted); font-size: .75rem;
  letter-spacing: .08em; text-transform: uppercase; padding: .4rem 1.4rem; border-bottom: 1px solid var(--line); }
table.roster td { padding: .45rem 1.4rem; border-bottom: 1px solid rgba(255, 255, 255, .04); }
table.roster tr.hidden { display: none; }
.roster-name { color: var(--text); overflow-wrap: anywhere; }
.roster-title { display: block; color: var(--muted); font-size: .8rem; }
.roster-rank.rank-2 { color: var(--gold); }
.roster-rank.rank-3 { color: var(--emerald); }
@media (max-width: 560px) {
  table.roster th, table.roster td { padding-left: .8rem; padding-right: .8rem; }
  a.card.faction-link, .faction-top { padding-left: .9rem; padding-right: .9rem; }
}
.faction-mine { align-self: flex-start; margin-top: .3rem; padding: .1rem .5rem; border: 1px solid var(--emerald-d);
  border-radius: var(--radius); color: var(--emerald); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; }
.faction-private { margin: 0; padding: 0 1.4rem .6rem; font-size: .9rem; }
@media (max-width: 560px) { .faction-private { padding: 0 .9rem 1rem; } }
.faction-switch { margin: .75rem 0 0; font-size: .95rem; }

/* ── friends ── */
.friends-card h3 { margin-bottom: .25rem; }
.friends-count { margin: 0 0 .75rem; }
.friends-group { margin: 1rem 0 .3rem; }
ul.friends { list-style: none; margin: 0; padding: 0; }
li.friend { display: flex; align-items: center; gap: .75rem; padding: .55rem 0; border-top: 1px solid rgba(255, 255, 255, .05); }
li.friend:first-child { border-top: none; }
.friend-dot { width: .6rem; height: .6rem; border-radius: 50%; flex: none; background: var(--line-lit, #3a4a44); }
.friend-dot.on { background: var(--emerald); box-shadow: 0 0 6px rgba(53, 214, 160, .6); }
.friend-dot.unknown { background: transparent; border: 1px solid var(--muted); }
.friend-main { display: flex; flex-direction: column; min-width: 0; }
.friend-name { color: var(--text); overflow-wrap: anywhere; }
.friend-main .quiet { font-size: .85rem; }
.friend-status { margin-left: auto; color: var(--muted); font-size: .85rem; text-align: right; }
.friend-status.on { color: var(--emerald); }

/* ── vote ── */
.vote-head { display: flex; align-items: baseline; gap: 1rem; margin-bottom: .75rem; }
.vote-head h3 { margin: 0; }
.vote-state { margin-left: auto; color: var(--muted); font-size: .85rem; }
.vote-state.ready { color: var(--emerald); }
.vote-note { margin: .6rem 0 0; font-size: .85rem; }
ul.vote-history { list-style: none; margin: 0; padding: 0; }
li.vote-row { display: flex; gap: .75rem; padding: .45rem 0; border-top: 1px solid rgba(255, 255, 255, .05); font-size: .9rem; flex-wrap: wrap; }
li.vote-row:first-child { border-top: none; }
.vote-result { margin-left: auto; }
li.vote-row.credited .vote-result { color: var(--emerald); }
.vote-balance { margin-left: auto; font-size: 1.15rem; font-weight: 600; color: var(--emerald); }
.vote-form select, .vote-form input { width: 100%; }
.vote-actions { margin-top: 1rem; }
li.vote-row.send .vote-result { color: var(--muted); }
li.vote-row.send.partial .vote-result, li.vote-row.send.failed .vote-result, li.vote-row.send.unconfirmed .vote-result { color: var(--bad); }

/* ── news and events ──────────────────────────────────────────────────────── */
.center { text-align: center; }
.news-grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
             align-items: start; margin-bottom: 1.8rem; }
.news-head { font-size: 1.3rem; margin: 2rem 0 1rem; }
.news-head:first-child { margin-top: 0; }
.post { padding: 1.4rem 1.6rem; scroll-margin-top: 5rem; }
.post > h3 { color: var(--gold); font-size: 1.15rem; margin-bottom: .6rem; }
.post-when { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
             letter-spacing: .08em; margin-bottom: .6rem; color: var(--muted); }
.post-tag { color: var(--emerald); border: 1px solid var(--emerald-d); border-radius: var(--radius);
            padding: .1rem .45rem; letter-spacing: .18em; }
.post-tag.now { background: var(--emerald); color: #04120d; border-color: var(--emerald); }
.post.event { border-color: var(--line-lit); }
/* Plain text as written: the GM's own line breaks are the only layout a post has. */
.post-body { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--muted); font-size: .95rem; }
.post-more { display: inline-block; margin-top: .6rem; font-size: .9rem; }

/* ── rates ────────────────────────────────────────────────────────────────── */
.rates { display: grid; gap: 1rem; grid-template-columns: repeat(4, 1fr); max-width: 52rem; margin: 0 auto; }
@media (max-width: 640px) { .rates { grid-template-columns: repeat(2, 1fr); } }
.rate { display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: 1.3rem 1rem;
        border: 1px solid var(--line); border-radius: var(--radius); background: var(--raised); }
.rate-value { font-family: var(--display); font-size: 2.3rem; line-height: 1; color: var(--text); }
.rate.boosted { border-color: var(--emerald-d); }
.rate.boosted .rate-value { color: var(--emerald); }
.rate-label { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .16em; }
.rate-note { margin: 1rem 0 1.8rem; font-size: .9rem; }
ul.facts { list-style: none; padding: 0; margin: 0 auto; max-width: 44rem; display: grid; gap: .7rem; }
ul.facts li { position: relative; padding-left: 1.4rem; color: var(--muted); font-size: .95rem; }
ul.facts li::before { content: ""; position: absolute; left: .2rem; top: .55em; width: 6px; height: 6px;
                      background: var(--emerald-d); transform: rotate(45deg); }
ul.facts strong { color: var(--text); font-weight: 600; }

/* ── server time ──────────────────────────────────────────────────────────── */
.server-clock { margin: -.4rem 0 1.4rem; color: var(--muted); font-size: .9rem; }
.server-clock strong { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ── classes ──────────────────────────────────────────────────────────────── */
.class-intro { margin-top: -1rem; margin-bottom: 1.6rem; }
.classes { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.class-card { padding: 1.1rem 1.2rem; border: 1px solid var(--line); border-radius: var(--radius);
              background: linear-gradient(180deg, var(--raised), var(--bg-lift)); }
.class-card h3 { color: var(--gold); margin: 0 0 .35rem; }
.class-role { display: inline-block; margin-bottom: .6rem; padding: .1rem .45rem; font-size: .68rem;
              text-transform: uppercase; letter-spacing: .14em; color: var(--emerald);
              border: 1px solid var(--emerald-d); border-radius: var(--radius); }
.class-card p { margin: 0; color: var(--muted); font-size: .92rem; }

/* ── weekly blessings ─────────────────────────────────────────────────────── */
ul.blessings { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: .6rem; }
li.blessing { display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .75rem .9rem; border: 1px solid var(--line); border-radius: var(--radius); background: #060a09; }
li.blessing > div { display: flex; flex-direction: column; gap: .1rem; flex: 1 1 10rem; min-width: 0; }
li.blessing .btn { margin: 0; width: auto; flex: none; }  /* the label wraps, the button stays on the right */
.small-note { font-size: .85rem; }

/* ── timed events and countdowns ─────────────────────────────────────────── */
ul.schedule { list-style: none; padding: 0; margin: 0 auto 1.8rem; max-width: 52rem; display: grid; gap: .5rem; }
li.schedule-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem .9rem;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--raised); }
li.schedule-row.running { border-color: var(--emerald-d); }
li.schedule-row > div { display: flex; flex-direction: column; gap: .1rem; min-width: 0; flex: 1 1 12rem; }
.schedule-title { color: var(--text); font-weight: 600; }
.schedule-when { font-size: .82rem; }
.countdown { flex: none; font-variant-numeric: tabular-nums; font-size: .88rem; color: var(--muted); white-space: nowrap; }
.countdown.soon { color: var(--gold); }
.countdown.now { color: var(--emerald); font-weight: 600; }
.post .countdown { display: block; margin: -.2rem 0 .6rem; }

/* ── rankings ─────────────────────────────────────────────────────────────── */
.rank-tabs { display: flex; gap: .5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.rank-tabs button { padding: .45rem .9rem; border: 1px solid var(--line-lit); border-radius: var(--radius);
  background: #060a09; color: var(--muted); font: inherit; cursor: pointer; }
.rank-tabs button[aria-selected="true"] { border-color: var(--emerald); color: var(--emerald); }
.rank-tabs button:focus-visible { outline: 2px solid var(--emerald); outline-offset: 2px; }
.rank-box { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--raised); }
table.rank-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.rank-table th, .rank-table td { text-align: left; padding: .55rem .8rem; border-bottom: 1px solid var(--line); }
.rank-table th { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; }
.rank-table tr:last-child td { border-bottom: 0; }
.rank-table .rank-name { color: var(--text); font-weight: 600; }
.rank-table tr.top1 td:first-child, .rank-table tr.top2 td:first-child, .rank-table tr.top3 td:first-child { color: var(--gold); font-weight: 700; }
label.check-row { display: flex; align-items: center; gap: .6rem; margin: .5rem 0 0; text-transform: none; letter-spacing: 0; font-size: .95rem; font-weight: 400; color: var(--muted); }
label.check-row input { width: auto; margin: 0; }

/* ── item lookup ──────────────────────────────────────────────────────────── */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
form.item-search { display: flex; gap: .5rem; margin: 0 0 1rem; }
form.item-search input { flex: 1 1 auto; min-width: 0; }
form.item-search button { flex: none; }
ul.item-hits { list-style: none; margin: 0 0 1.5rem; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--raised); }
ul.item-hits li { display: flex; flex-wrap: wrap; gap: .2rem .8rem; align-items: baseline; padding: .5rem .8rem; border-bottom: 1px solid var(--line); }
ul.item-hits li:last-child { border-bottom: 0; }
ul.item-hits a { font-weight: 600; }
ul.item-hits .quiet { font-size: .85rem; }
.item-card { border: 1px solid var(--line-lit); border-radius: var(--radius); background: var(--raised); padding: 1rem 1.2rem; }
.item-card h2 { margin: 0 0 .2rem; }
.item-src { margin-top: 1.2rem; }
.item-src h3 { margin: 0 0 .4rem; font-size: 1rem; color: var(--gold); }
ul.item-list { list-style: none; margin: 0; padding: 0; }
ul.item-list li { padding: .5rem 0; border-top: 1px solid var(--line); }
.item-row-head { display: flex; flex-wrap: wrap; gap: .2rem .8rem; align-items: baseline; }
.item-row-head strong { color: var(--text); }
.item-row-head .quiet, .item-places, .item-mats { font-size: .88rem; }
.item-places { color: var(--muted); font-variant-numeric: tabular-nums; }
.item-mats { margin: .15rem 0; }

/* ── packs ────────────────────────────────────────────────────────────────── */
label.pack-filter { margin: -.4rem 0 .6rem; }
.pack-list { border: 1px solid var(--line); border-radius: var(--radius); background: var(--raised); }
details.pack { border-bottom: 1px solid var(--line); }
details.pack:last-child { border-bottom: 0; }
details.pack > summary { display: flex; flex-wrap: wrap; gap: .2rem .8rem; align-items: baseline; padding: .55rem .8rem; cursor: pointer; }
details.pack > summary .quiet { font-size: .85rem; }
details.pack[open] > summary { border-bottom: 1px solid var(--line); }
.pack-name { color: var(--text); font-weight: 600; }
.pack-body { padding: .4rem .8rem .8rem; }
.pack-pick, .pack-outcome-head { margin: .6rem 0 .25rem; font-size: .88rem; color: var(--gold); }
.pack-outcome { border-left: 2px solid var(--line-lit); padding-left: .7rem; margin: .5rem 0; }
ul.pack-items { list-style: none; margin: 0; padding: 0; columns: 2 16rem; column-gap: 1.5rem; }
ul.pack-items li { padding: .15rem 0; break-inside: avoid; font-size: .92rem; }
.pack-odds { margin-left: .5rem; color: var(--muted); font-size: .82rem; font-variant-numeric: tabular-nums; }
