/* Perpetua brand: gold linework on a deep royal-navy field. Single dark theme by design.
   Shared by every page; page-specific bits live in each page's own <style>. */
:root {
  color-scheme: dark;
  --gold: #d4af37;
  --gold-pale: #f2d78c;
  --gold-deep: #c9a227;
  --gold-warm: #e8c874;
  --navy: #0e1a40;
  --midnight: #0c1730;
  --royal: #152a5e;
  --royal-light: #1c2f6e;
  --text: #efe6c8;
  --muted: #a3acc9;
  --line: rgba(212, 175, 55, 0.32);
  --track: rgba(163, 172, 201, 0.12);
  --danger: #ff8a7a;
  --ok: #8fd18a;
  /* Section tints (docs/design.md §2): banner edges, notches, card tops only. */
  --raids: #c0503f;
  --help: #5d97d8;
  --stage: #9b7fe0;
  --officer: #c0503f;
  --sec: var(--gold);
  --rail: 96px;
  --display: "Cinzel", "Trajan Pro", Georgia, serif;
  --serif: "Cormorant Garamond", "Garamond", Georgia, serif;
}

body {
  margin: 0;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28'%3E%3Cpath d='M4 4l7 7M18 18l7 7' stroke='%23d4af37' stroke-opacity='.05' stroke-width='1.2' stroke-linecap='round'/%3E%3C/svg%3E"),
    radial-gradient(ellipse 80% 55% at 50% 18%, var(--royal-light), var(--navy) 70%, var(--midnight));
  background-color: var(--navy);
  background-attachment: fixed;
  color: var(--text);
  font: 500 19px/1.45 var(--serif);
  min-height: 100vh;
  padding-block: 48px 40px;
  padding-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px));
  box-sizing: border-box;
}
*, *::before, *::after { box-sizing: inherit; }
html { -webkit-text-size-adjust: 100%; }
a, button, select, .chip { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
[hidden] { display: none !important; }

/* Crest header */
.hero { display: grid; justify-items: center; gap: 14px; text-align: center; }
.emblem { width: 92px; height: 92px; }
h1 {
  margin: 0;
  font: 700 clamp(34px, 9vw, 52px)/1 var(--display);
  letter-spacing: 0.17em;
  margin-right: -0.17em;
  color: var(--gold);
  text-transform: uppercase;
}
.rule { display: flex; align-items: center; gap: 12px; color: var(--gold); }
.rule::before, .rule::after { content: ""; width: 64px; height: 1px; background: var(--gold); opacity: .7; }
.rule i { width: 8px; height: 8px; background: currentColor; transform: rotate(45deg); }
.tagline {
  margin: 0;
  font: italic 500 17px/1.3 var(--serif);
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--gold-warm);
  text-wrap: balance;
}
.lede { margin: 4px 0 0; max-width: 34em; font-size: 20px; text-wrap: pretty; }
.lede strong { color: var(--gold-pale); font-weight: 700; }

/* Buttons */
.cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font: 700 14px/1 var(--display);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--navy);
  background: var(--gold);
  border: 1px solid var(--gold-pale);
  border-radius: 2px;
  padding: 18px 34px;
  box-shadow: 0 0 0 4px var(--navy), 0 0 0 5px rgba(212, 175, 55, .45);
  transition: background .15s;
  cursor: pointer;
}
.cta:hover { background: var(--gold-pale); }
.cta:active { background: var(--gold-deep); }
.cta:focus-visible { outline: 2px solid var(--gold-pale); outline-offset: 8px; }
.cta.alt { background: transparent; color: var(--gold); border-color: var(--gold); }
.cta.alt:hover { background: rgba(212, 175, 55, .12); color: var(--gold-pale); }
.cta .ico { width: 18px; height: 18px; margin-block: -2px; fill: currentColor; flex: none; }
.cta[disabled] { opacity: .7; cursor: progress; }
.ctas { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px 22px; margin-top: 10px; }
.discord-btn { background: #5865f2; border-color: #8891f7; color: #fff; box-shadow: 0 0 0 4px var(--navy), 0 0 0 5px rgba(136, 145, 247, .5); }
.discord-btn:hover { background: #6d78f4; }
.discord-btn:active { background: #4752c4; }

.textlink { color: var(--gold-warm); text-decoration: underline; text-underline-offset: 3px; }
.textlink:hover { color: var(--gold-pale); }
/* Every page's content column: one width site-wide, so pages line up as you move between them. */
.shell, .page, .home { width: 100%; max-width: 896px; margin-inline: auto; }

.back {
  justify-self: start; font: 600 12px/1 var(--display); letter-spacing: .16em; text-transform: uppercase;
  color: var(--gold-warm); text-decoration: none; padding: 6px 0;
}
.back:hover { color: var(--gold-pale); }

/* Framed panel: double line, dashed seam, corner brackets */
.card {
  position: relative;
  background: linear-gradient(180deg, rgba(21, 42, 94, .55), rgba(12, 23, 48, .75));
  border: 1px solid var(--gold);
  padding: 40px 36px 34px;
}
.card::before, .card::after { content: ""; position: absolute; pointer-events: none; }
.card::before { inset: 5px; border: 1px dashed rgba(212, 175, 55, .22); }
.card::after  { inset: 10px; border: 1px solid rgba(212, 175, 55, .38); }
.corner { position: absolute; width: 46px; height: 46px; pointer-events: none; z-index: 1; }
.corner.tl { top: -8px; left: -8px; }
.corner.tr { top: -8px; right: -8px; transform: scaleX(-1); }
.corner.bl { bottom: -8px; left: -8px; transform: scaleY(-1); }
.corner.br { bottom: -8px; right: -8px; transform: scale(-1, -1); }
.card-body { position: relative; z-index: 2; display: grid; gap: 24px; }
/* Plain panel: single gold hairline, for secondary content */
.panel { border: 1px solid var(--line); background: rgba(12, 23, 48, .55); padding: 24px 24px 22px; display: grid; gap: 12px; }

h2 {
  margin: 0;
  font: 700 20px/1.2 var(--display);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}
h3 {
  margin: 0;
  font: 600 13px/1.2 var(--display);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-warm);
}
p { margin: 0; }
.muted { color: var(--muted); }
.note { font-size: 15px; font-style: italic; color: var(--muted); }
.panel-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; }
.meta { font-style: italic; color: var(--muted); font-size: 16px; }

/* Forms */
form { display: grid; gap: 24px; }
.field { display: grid; gap: 8px; border: 0; margin: 0; padding: 0; min-width: 0; }
.field > label, legend, .label {
  font: 600 13px/1.2 var(--display);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  padding: 0;
}
legend small, .field > label small { font: italic 500 15px var(--serif); letter-spacing: .04em; text-transform: none; color: var(--muted); margin-left: 6px; }
.hint { font-size: 16px; color: var(--muted); }
input[type="text"], input[type="time"], input[type="number"], select, textarea {
  width: 100%;
  font: 600 19px/1.3 var(--serif);
  color: var(--text);
  background: var(--midnight);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 11px 14px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
textarea { font-weight: 500; resize: vertical; min-height: 5.5em; }
input[type="time"] { color-scheme: dark; }
input::placeholder, textarea::placeholder { color: #6f7aa0; font-style: italic; }
select {
  appearance: none;
  padding-right: 40px;
  background-image: linear-gradient(45deg, transparent 50%, var(--gold) 50%), linear-gradient(135deg, var(--gold) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
  background-size: 6px 6px;
  background-repeat: no-repeat;
  cursor: pointer;
}
select option { background: var(--midnight); color: var(--text); }
input:hover, select:hover, textarea:hover { border-color: rgba(212, 175, 55, .6); }
input:focus, select:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212, 175, 55, .18); }
.field.invalid input, .field.invalid select, .field.invalid textarea, .field.invalid .chip span { border-color: var(--danger); }
.error { color: var(--danger); font-size: 16px; }
.row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
input, select, textarea { min-width: 0; }

/* Chip groups (roles, specs, days) */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { position: relative; flex: 1 1 120px; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 10px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--midnight);
  color: var(--text);
  font: 600 12px/1.2 var(--display);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: border-color .15s, background .15s, color .15s;
  user-select: none;
  min-height: 44px;
  text-align: center;
}
.chip svg { width: 16px; height: 16px; flex: none; fill: currentColor; opacity: .85; }
.chip:hover span { border-color: rgba(212, 175, 55, .6); }
.chip input:focus-visible + span { box-shadow: 0 0 0 3px rgba(212, 175, 55, .35); }
.chip input:checked + span {
  border-color: var(--gold);
  background: rgba(212, 175, 55, .12);
  color: var(--gold-pale);
  box-shadow: inset 0 0 0 1px rgba(212, 175, 55, .35);
}
.chips.days .chip { flex: 1 1 0; min-width: 0; }
.chips.days .chip span { padding: 11px 2px; letter-spacing: .06em; }
.spec-empty { padding: 11px 14px; border: 1px dashed var(--line); border-radius: 2px; color: var(--muted); font-style: italic; }

/* A character block inside a form (main or alt) */
.char { display: grid; gap: 18px; padding: 20px; border: 1px solid var(--line); background: rgba(12, 23, 48, .45); }
.char-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.char-head .class-pill { display: inline-flex; align-items: center; gap: 8px; font-size: 16px; font-style: italic; color: var(--muted); }
.class-pill i { width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--gold)); box-shadow: 0 0 8px var(--c, var(--gold)); }
/* Undecided players (class "Undecided" + a shortlist): banner stripes of their classes' colours (--bands from
   classVars() in perpetua.js) on the edge, the name in plain cream, and the classes named in their own colours. */
.undecided-text, .undecided b { color: var(--text); -webkit-text-fill-color: var(--text); }
.class-pill.undecided span { color: var(--text); font-style: normal; font-weight: 700; }
.class-pill.undecided i { background: linear-gradient(90deg, var(--bands)); box-shadow: 0 0 8px var(--c); }
.class-names em { font-style: normal; font-weight: 600; }
.class-names .sep { color: var(--muted); }
.mine li.undecided { position: relative; border-left-color: transparent; }
.mine li.undecided::before { content: ""; position: absolute; left: -4px; top: -1px; bottom: -1px; width: 4px; background: linear-gradient(180deg, var(--bands)); }
.mine li .link-btn + .link-btn { margin-left: 0; }
/* The class chips an undecided player ticks, each in its class colour. */
.chip.cls-pick span i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; }
.chip.cls-pick input:checked + span { border-color: var(--c); background: color-mix(in srgb, var(--c) 14%, var(--midnight));
  color: var(--text); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 45%, transparent); }
.chip.cls-pick input:checked + span i { box-shadow: 0 0 6px var(--c); }
.link-btn {
  background: none; border: 0; color: var(--gold-warm); font: italic 500 17px var(--serif);
  cursor: pointer; text-decoration: underline; text-underline-offset: 3px; padding: 4px;
}
.link-btn:hover { color: var(--gold-pale); }
.link-btn:focus-visible, .back:focus-visible, .textlink:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.status { font-size: 17px; text-align: center; font-style: italic; min-height: 1.4em; }
.status.err { color: var(--danger); }
.status:empty { display: none; }

/* Signed-in identity strip */
.who { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--line); background: rgba(12, 23, 48, .55); font-size: 17px; }
.who img, .who .av { width: 36px; height: 36px; border-radius: 50%; flex: none; background: var(--royal); border: 1px solid var(--line); }
.who b { color: var(--gold-pale); }
.who .link-btn { margin-left: auto; font-size: 15px; }

.state { text-align: center; font-style: italic; color: var(--muted); padding: 24px 0; }
.state.err { color: var(--danger); }

/* Gold-lit notice */
.alert {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px;
  border: 1px solid var(--gold); border-left: 4px solid var(--gold);
  background: linear-gradient(90deg, rgba(212, 175, 55, .16), rgba(212, 175, 55, .05)), #0b1533;
  font-size: 18px; font-weight: 600; line-height: 1.4; color: #fff8e6; text-wrap: pretty;
}
.alert.err { border-color: var(--danger); background: linear-gradient(90deg, rgba(255, 138, 122, .14), rgba(255, 138, 122, .04)), #0b1533; }

footer { text-align: center; font: italic 500 15px var(--serif); letter-spacing: .06em; color: var(--muted); }
footer a { color: var(--gold-warm); text-decoration: underline; text-underline-offset: 3px; }
footer a:hover { color: var(--gold-pale); }

@media (max-width: 560px) {
  body { padding-block: 24px 28px; background-attachment: scroll; }
  .emblem { width: 72px; height: 72px; }
  .tagline { letter-spacing: .18em; font-size: 15px; }
  .lede { font-size: 18px; }
  .cta { width: 100%; padding: 18px 12px; }
  .card { padding: 30px 18px 24px; }
  .panel { padding: 20px 16px; }
  .char { padding: 16px 12px; }
  h2 { font-size: 16px; letter-spacing: .12em; }
  .row2 { grid-template-columns: 1fr; }
  .chips { gap: 8px; }
  .chips.days { gap: 4px; }
  .chips.days .chip span { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* Pop-up dialog (recruiting on the home page, approval notice anywhere) */
.popup { padding: 8px; border: 0; background: transparent; color: var(--text); max-width: min(580px, calc(100vw - 16px)); width: 100%;
  max-height: calc(100dvh - 16px); overflow-y: auto; }
.popup::backdrop { background: rgba(6, 12, 28, .72); backdrop-filter: blur(3px); }
.popup .card { padding: 40px 34px 30px; background: linear-gradient(180deg, var(--royal), var(--midnight)); box-shadow: 0 20px 60px rgba(0, 0, 0, .55); }
.popup .card-body { gap: 14px; justify-items: center; text-align: center; }
.popup .cta { margin-top: 6px; }
.popup .motto { font: italic 500 18px/1.35 var(--serif); letter-spacing: .14em; text-transform: uppercase; color: var(--gold-warm); text-wrap: balance; }
.popup .emblem { width: 72px; height: 72px; }
.popup h2 { font-size: 22px; line-height: 1.3; text-wrap: balance; }
.popup p { max-width: 30em; font-size: 18px; line-height: 1.45; text-wrap: pretty; }
.popup .close { position: absolute; top: 16px; right: 18px; z-index: 3; background: none; border: 0; color: var(--gold-warm);
  font: 400 28px/1 var(--serif); cursor: pointer; padding: 4px 8px; }
.popup .close:hover { color: var(--gold-pale); }
.popup .close:focus-visible, .popup .dont input:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.popup .dont { display: flex; align-items: center; gap: 8px; font-size: 16px; color: var(--muted); cursor: pointer; }
.popup .dont input { accent-color: var(--gold); width: 16px; height: 16px; margin: 0; }
.popup[open] { animation: popup-in .35s ease-out; }
@keyframes popup-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }
@media (prefers-reduced-motion: reduce) { .popup[open] { animation: none; } }
@media (max-width: 560px) { .popup .card { padding: 30px 16px 22px; } .popup h2 { font-size: 18px; } .popup p { font-size: 17px; } .popup .motto { font-size: 15px; letter-spacing: .1em; } .popup .emblem { width: 56px; height: 56px; } }

/* A Forever surname next to the first name: same colour, lighter weight. */
.surname { font-weight: 500; opacity: .78; }

/* Link-code panel (Members and addon pages) */
.link-panel { display: grid; gap: 12px; padding: 18px 20px; border: 1px solid var(--line); background: rgba(12, 23, 48, .55); }
.link-panel .cta { justify-self: start; padding: 14px 24px; }
/* A game command to copy: monospace block, click copies (perpetua.js wireLinkPanel). */
.command { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; text-align: left; cursor: pointer;
  padding: 14px 16px; background: var(--midnight); border: 1px solid var(--line); border-left: 3px solid var(--gold); border-radius: 2px;
  color: var(--gold-pale); transition: border-color .15s, background .15s; }
.command:hover { border-color: var(--gold); background: #0f1d3d; }
.command:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.command code { font: 600 20px/1.3 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; letter-spacing: .04em; overflow-wrap: anywhere; }
.command .copied { flex: none; font: 600 11px/1 var(--display); letter-spacing: .16em; text-transform: uppercase; color: var(--gold-warm); }
.command.done { border-color: var(--ok); border-left-color: var(--ok); }
.command.done .copied { color: var(--ok); }

/* Site menu (perpetua.js siteMenu): the More panel, opened from the pennant rail, slides in from the right.
   The old top-right button stays in the DOM only for pages with data-no-rail. */
.menu-btn { display: none; }
[data-no-rail] .menu-btn { position: fixed; top: max(14px, env(safe-area-inset-top, 0px)); right: max(14px, env(safe-area-inset-right, 0px)); z-index: 60;
  width: 46px; height: 46px; display: grid; place-content: center; gap: 5px; cursor: pointer;
  background: rgba(12, 23, 48, .88); border: 1px solid var(--gold); border-radius: 2px;
  box-shadow: 0 0 0 3px rgba(14, 26, 64, .8), 0 6px 18px rgba(0, 0, 0, .35); backdrop-filter: blur(4px); }
.menu-btn i { display: block; width: 20px; height: 2px; background: var(--gold); border-radius: 1px; transition: transform .2s, opacity .2s; }
.menu-btn:hover i { background: var(--gold-pale); }
.menu-btn:focus-visible { outline: 2px solid var(--gold-pale); outline-offset: 3px; }
.menu-open .menu-btn i:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-open .menu-btn i:nth-child(2) { opacity: 0; }
.menu-open .menu-btn i:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.menu-shade { position: fixed; inset: 0; z-index: 58; background: rgba(6, 12, 28, .6); backdrop-filter: blur(2px); }
/* The More panel opens out of the rail on the left (on phones from the left edge, above the tab bar). */
.site-menu { position: fixed; top: 0; left: var(--rail); bottom: 0; z-index: 59; width: min(320px, 88vw); overflow-y: auto;
  padding: 22px 26px 30px; display: grid; align-content: start; gap: 22px;
  background: linear-gradient(180deg, var(--royal), var(--midnight)); border-right: 1px solid var(--gold);
  box-shadow: 18px 0 50px rgba(0, 0, 0, .5); animation: menu-in .22s ease-out; }
.site-menu::before { content: ""; position: absolute; inset: 0 6px 0 auto; border-right: 1px solid rgba(212, 175, 55, .3); pointer-events: none; }
@keyframes menu-in { from { transform: translateX(-24px); opacity: 0; } }
@media (max-width: 760px) { .site-menu { left: 0; bottom: calc(66px + env(safe-area-inset-bottom, 0px)); } }
[data-no-rail] .site-menu { left: auto; right: 0; bottom: 0; border-right: 0; border-left: 1px solid var(--gold); box-shadow: -18px 0 50px rgba(0, 0, 0, .5); }
.menu-head { display: flex; align-items: center; gap: 12px; padding-right: 50px; }
.menu-head b { font: 700 18px/1 var(--display); letter-spacing: .2em; text-transform: uppercase; color: var(--gold); }
.menu-crest { width: 34px; height: 34px; flex: none; }
.menu-group { display: grid; gap: 2px; }
.menu-group h3 { margin-bottom: 6px; padding-bottom: 6px; border-bottom: 1px solid var(--line); color: var(--gold-warm); font-size: 11px; }
.menu-group a { padding: 7px 10px; margin-left: -10px; border-left: 2px solid transparent; color: var(--text); text-decoration: none; font-size: 19px; }
.menu-group a:hover { color: var(--gold-pale); background: rgba(212, 175, 55, .08); }
.menu-group a[aria-current="page"] { border-left-color: var(--gold); color: var(--gold-pale); background: rgba(212, 175, 55, .1); }
.view-as-bar { position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 50; display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; justify-content: center; max-width: calc(100% - 32px); padding: 10px 18px; border: 1px solid #f0b35a; background: rgba(12, 23, 48, .95); color: #f0b35a; font: 600 12px/1.3 var(--display); letter-spacing: .12em; text-transform: uppercase; box-shadow: 0 6px 24px rgba(0, 0, 0, .5); }
.view-as-bar a { color: var(--gold-pale); }
.menu-count { display: inline-block; min-width: 1.5em; margin-left: 6px; padding: 2px 6px; border-radius: 9px; background: var(--danger); color: var(--navy); font: 700 12px/1.2 var(--display); text-align: center; vertical-align: 2px; }
.menu-off { margin-left: 8px; padding: 2px 6px; border: 1px solid var(--muted); color: var(--muted); font: 600 9px/1.2 var(--display); letter-spacing: .12em; vertical-align: 1px; }
.menu-review { display: inline-block; margin-left: 6px; padding: 2px 6px; border: 1px solid #f0b35a; color: #f0b35a; font: 600 9px/1.2 var(--display); letter-spacing: .12em; text-transform: uppercase; vertical-align: 3px; }
.menu-group a:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
/* The addon card: a gilded frame with a slow sheen, so it reads as something worth a look. */
.menu-group a.menu-addon { position: relative; overflow: hidden; display: flex; align-items: center; gap: 12px; margin: 10px 0 2px; padding: 12px;
  border: 1px solid var(--gold); background: linear-gradient(135deg, rgba(212, 175, 55, .22), rgba(28, 47, 110, .6) 55%, rgba(212, 175, 55, .12));
  box-shadow: 0 0 0 1px rgba(212, 175, 55, .18), 0 6px 22px rgba(212, 175, 55, .16); }
.menu-group a.menu-addon::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 240, 200, .28) 50%, transparent 65%); transform: translateX(-120%);
  animation: addon-sheen 5s ease-in-out 1s infinite; }
@keyframes addon-sheen { 0%, 60% { transform: translateX(-120%); } 85%, 100% { transform: translateX(120%); } }
.menu-group a.menu-addon:hover, .menu-group a.menu-addon[aria-current="page"] { border-color: var(--gold-pale); background: linear-gradient(135deg, rgba(212, 175, 55, .32), rgba(28, 47, 110, .65) 55%, rgba(212, 175, 55, .18)); }
.menu-addon-ico { flex: none; width: 34px; height: 34px; filter: drop-shadow(0 0 6px rgba(212, 175, 55, .55)); }
.menu-addon b { display: block; font: 700 13px/1.2 var(--display); letter-spacing: .12em; text-transform: uppercase; color: var(--gold-pale); }
.menu-addon small { display: block; margin-top: 3px; font-size: 14px; font-style: italic; line-height: 1.25; color: var(--text); opacity: .85; }
.menu-who { display: flex; align-items: center; gap: 10px; padding: 4px 0 6px; color: var(--gold-pale); font-weight: 700; }
.menu-who img { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); }
@media (prefers-reduced-motion: reduce) { .site-menu { animation: none; } .menu-btn i { transition: none; } .menu-group a.menu-addon::after { animation: none; display: none; } }

/* Loot lists (perpetua.js lootList) */
.loot { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.loot li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 14px; align-items: baseline; padding: 9px 12px;
  border: 1px solid rgba(212, 175, 55, .16); border-left: 3px solid var(--q, var(--gold)); background: rgba(12, 23, 48, .55); }
.loot-item { color: var(--q); font-weight: 700; font-size: 18px; text-decoration: none; }
.loot-item:hover { text-decoration: underline; text-underline-offset: 3px; }
.loot-meta { grid-column: 1; font-size: 15px; color: var(--muted); font-style: italic; }
.loot-who { color: var(--c, var(--text)); font-style: normal; font-weight: 700; text-decoration: none; }
a.loot-who:hover { text-decoration: underline; }
.rolls { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px; }
.roll { font-size: 14px; padding: 1px 8px; border: 1px solid var(--line); background: var(--midnight); color: var(--muted); }
.roll b { color: var(--text); font-family: var(--display); font-size: 12px; }
.roll small { font-size: 11px; }
.roll.won { border-color: var(--gold); color: var(--gold-pale); background: rgba(212, 175, 55, .12); }
.loot-del { grid-column: 2; grid-row: 1; font-size: 14px; }
.command.code-only code { font: 700 30px/1.2 var(--display); letter-spacing: .3em; }

/* ---------- The Standard (docs/design.md) ---------- */
html[data-section="raids"] { --sec: var(--raids); }
html[data-section="help"] { --sec: var(--help); }
html[data-section="stage"] { --sec: var(--stage); }
html[data-section="officers"] { --sec: var(--officer); }

/* Swallowtail cuts */
.tail { clip-path: polygon(0 0, 100% 0, 100% 100%, 50% calc(100% - 28px), 0 100%); padding-bottom: 52px; }
.tail-sm { clip-path: polygon(0 0, 100% 0, 100% 100%, 50% calc(100% - 14px), 0 100%); }

/* Pennant rail (desktop) / tab bar (phone), drawn by perpetua.js. Space is kept for it before the script runs. */
html:not([data-no-rail]) body { padding-left: calc(var(--rail) + max(16px, env(safe-area-inset-left, 0px))); }
.rail { position: fixed; inset: 0 auto 0 0; width: var(--rail); z-index: 55; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 16px 0; background: linear-gradient(180deg, rgba(12, 23, 48, .97), rgba(14, 26, 64, .97)); border-right: 1px solid var(--line); }
.rail-crest { display: block; width: 58px; height: 58px; margin-bottom: 10px; }
.rail-crest svg { width: 100%; height: 100%; }
.pen { position: relative; display: grid; justify-items: center; gap: 4px; width: 72px; padding: 10px 0 18px; text-decoration: none; color: var(--muted);
  background: rgba(21, 42, 94, .35); border: 0; cursor: pointer; font: inherit;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 84%, 0 100%); transition: background .15s, color .15s, transform .15s; }
.pen svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.pen span { font: 600 9px/1.2 var(--display); letter-spacing: .12em; text-transform: uppercase; text-align: center; }
.pen:hover { color: var(--gold-pale); background: rgba(212, 175, 55, .12); transform: translateY(2px); }
.pen:focus-visible { outline: 2px solid var(--gold-pale); outline-offset: -2px; }
.pen[aria-current="page"] { color: var(--navy); background: linear-gradient(180deg, var(--gold-pale), var(--gold)); }
.pen .notch { position: absolute; top: 6px; right: 12px; width: 8px; height: 8px; background: var(--gold-pale); transform: rotate(45deg); box-shadow: 0 0 6px var(--gold); }
.pen[aria-current="page"] .notch { background: var(--navy); box-shadow: none; }
.rail { overflow-y: auto; scrollbar-width: none; }
/* Officers' pennants, below More: smaller, under a label. */
.rail-sep { margin: 10px 0 2px; font: 600 8px var(--display); letter-spacing: .22em; text-transform: uppercase; color: var(--officer, var(--gold-warm)); }
.pen.off { padding: 7px 0 14px; }
.pen.off svg { width: 18px; height: 18px; }
.pen.off span { font-size: 8px; }
.rail-me { margin-top: auto; flex: none; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--gold); background: var(--royal) center / cover;
  display: grid; place-items: center; font: 700 15px var(--display); color: var(--gold-pale); text-decoration: none; cursor: pointer; padding: 0; }
.rail-me:focus-visible { outline: 2px solid var(--gold-pale); outline-offset: 3px; }

@media (max-width: 760px) {
  html:not([data-no-rail]) body { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
  .rail { inset: auto 0 0 0; width: auto; height: auto; flex-direction: row; justify-content: space-around; gap: 2px;
    padding: 0 6px env(safe-area-inset-bottom, 0px); border-right: 0; border-top: 1px solid var(--line); }
  .rail-crest, .rail-me, .rail-sep, .pen.off { display: none; }
  .pen { width: auto; flex: 1; max-width: 80px; min-height: 64px; padding: 10px 0 16px; }
  .pen:hover { transform: none; }
  .view-as-bar { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
}
@media print { .rail { display: none; } html body { padding-left: 0; } }

/* Section banner: the top of every inner page (docs/design.md §3). */
.sec-banner { justify-self: start; display: grid; gap: 4px; padding: 16px 48px 26px 22px; margin: 0;
  background: linear-gradient(180deg, color-mix(in srgb, var(--sec) 40%, var(--royal)), var(--royal)); border-top: 3px solid var(--sec);
  clip-path: polygon(0 0, 100% 0, calc(100% - 24px) 50%, 100% 100%, 0 100%); }
.sec-banner h1 { font-size: clamp(26px, 4vw, 40px); letter-spacing: .12em; margin-right: 0; text-align: left; }
.sec-banner p { margin: 0; font-style: italic; color: var(--text); }
.sec-banner .eyebrow-link { font: 600 11px var(--display); letter-spacing: .2em; text-transform: uppercase; color: var(--gold-warm); text-decoration: none; }

/* Standards: the cards that matter now (home page and dashboards). */
.std { display: grid; gap: 14px; align-content: start; padding: 22px 20px 50px; border-top: 3px solid var(--sec);
  background: linear-gradient(180deg, rgba(21, 42, 94, .7), rgba(12, 23, 48, .7));
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% calc(100% - 28px), 0 100%); }
.std > h2 { margin: 0; font: 700 14px var(--display); letter-spacing: .2em; text-transform: uppercase; color: var(--sec); }
.std .big-line { font: 700 24px/1.15 var(--display); color: var(--gold-pale); letter-spacing: .04em; }
.std .sub-line { font-style: italic; color: var(--muted); font-size: 17px; }

/* Pennant chips: short facts in a row. */
.pennants { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 0; padding: 0; list-style: none; }
.pennants li { padding: 8px 16px 14px; font: 600 11px var(--display); letter-spacing: .16em; text-transform: uppercase; color: var(--gold-pale);
  background: rgba(21, 42, 94, .7); border-top: 2px solid var(--gold); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 78%, 0 100%); }
.pennants li.live { color: var(--ok); }

/* States: glyph + word (docs/design.md §5) */
.st { display: inline-flex; align-items: center; gap: 5px; font: 700 10px/1 var(--display); letter-spacing: .14em; text-transform: uppercase;
  padding: 5px 8px; border: 1px solid var(--line); color: var(--gold-pale); white-space: nowrap; }
.st.in { color: var(--ok); border-color: rgba(143, 209, 138, .6); }
.st.maybe { color: var(--gold-pale); border-style: dashed; border-color: var(--gold); }
.st.out { color: var(--muted); }
.st.ask { color: var(--sec); border-color: var(--sec); }
.st.lock { color: var(--muted); border-style: dashed; }

/* Section heading with the diamond rule, centred */
.sec-head { display: grid; justify-items: center; gap: 10px; text-align: center; }
.sec-head h2 { margin: 0; font: 700 clamp(22px, 3vw, 30px) var(--display); letter-spacing: .12em; text-transform: uppercase; color: var(--gold-pale); }
.sec-head p { margin: 0; }

/* "More ›" style links in card heads */
.more { white-space: nowrap; font: 600 12px var(--display); letter-spacing: .16em; text-transform: uppercase; color: var(--gold-warm); text-decoration: none; }
.more:hover { color: var(--gold-pale); }
