/* ============================================================================
   guild-sheet.css — the full-screen guild sheet (guilds full loop PR 3).
   Slide-up "dark glass console" per the hub-overlay design system; every frame
   flows through the --hg-frame-* tokens (with standalone fallbacks so pages
   that do not load hub-overlay.css still render correctly).
   ========================================================================== */

/* ── framed in the world (#2404 ruling, Wray 2026-09-05) ─────────────────
   "these pages need to render on the parchment not render in a window
   within the parchment, they need to look like the leaderboard page or
   the character screen." Inside a world door the sheet IS the page: no
   slide-up card, no dark glass panel, no second title bar with its own
   close (the parchment window already carries the banner and the x), no
   rounded corners (the loudest tell of the old chrome — framed-skin.css).
   guild.html tags body.embedded the same way nav.js does (self !== top,
   or ?embed=1). Standalone pages are untouched by everything below. */
body.embedded { display: block; }
body.embedded .idle { display: none; }
body.embedded .gsh-backdrop { display: none; }
body.embedded .gsh-sheet,
body.embedded.sheet-host .gsh-sheet {
  position: static;
  width: auto; max-width: none; height: auto; max-height: none; min-height: 100vh;
  transform: none; transition: none;
  border: 0; border-radius: 0; box-shadow: none;
  background: transparent;
  -webkit-backdrop-filter: none; backdrop-filter: none;
}
@media (min-width: 720px) {
  body.embedded .gsh-sheet,
  body.embedded .gsh-sheet.show { left: auto; width: auto; max-width: 720px; margin: 0 auto; transform: none; }
}
body.embedded .gsh-handle {
  position: static;
  background: transparent;
  border-bottom: 1px solid var(--border-subtle, rgba(162, 129, 85, .3));
  padding: 18px 16px 12px;
}
body.embedded .gsh-close { display: none; }
/* A GENERIC HEADING IS THE WINDOW'S (#3069 S13, GLD-1 / C17): "Guilds",
   "Your guild", "Join a guild" printed under the window's own "Guild"
   ribbon. guild-sheet.js marks the handle generic for those; a guild's own
   name is not generic and keeps its heading. Only in the HUD pass's slate
   window (world-windows-v2.js puts `hud-v2` on this page's body): the old
   window keeps its page exactly as it was. */
body.embedded.hud-v2 .gsh-handle.gsh-handle--generic { display: none; }
body.embedded .gsh-title {
  font-family: 'New Rocker', 'Press Start 2P', 'Cinzel', serif;
  font-weight: 400; font-size: 18px; letter-spacing: 0;
  text-shadow: none;
}

/* ── the world's clothes, not Warm Night's ────────────────────────────
   Wray, 2026-09-05, smoking this inside the world: "its in the purple
   glass not the 3d world style ... i want it to be on that parchment
   window."

   WHY THIS BLOCK EXISTS AT ALL, rather than framed-skin.css doing it:
   framed-skin.css re-points the v2 tokens (--bg-card, --gold, --border,
   --radius) so a page written against them changes with no edit. Its own
   header calls out the exception — "a page that hardcodes a colour instead
   will not change, and that is a useful signal ... it says exactly which
   pages still need hand work". This file is that page: every colour below
   line 100 is a literal `rgba(255,255,255,.04)` wash or a gold gradient
   with a purple fallback, so the skin swept past it and the sheet stayed
   Warm Night inside a Majesty window. This is the hand work.

   Restated in the world's vocabulary, per the drawn-chrome direction
   (#1953): value structure over hue — flat brass on dark instead of glass
   washes, gold hairlines instead of white ones, square instead of 8-18px
   radii, bitmap and tome faces instead of Cinzel, and no gradient on the
   primary button (the chunky-gradient button IS the muddiness, #2020).

   SCOPED TO body.embedded on purpose: the dashboard card and the public
   /g/<tag> page are Warm Night surfaces and must keep matching their own
   hosts. Only the framed-in-the-world case wears this. */
body.embedded {
  --gsh-ink:   #e6c88a;              /* the rail's ink */
  --gsh-sub:   rgba(230, 200, 138, .62);
  --gsh-faint: rgba(230, 200, 138, .42);
  --gsh-gold:  #caa982;              /* Majesty's gold, same as the rails */
  --gsh-line:  rgba(162, 129, 85, .48);
  --gsh-line-soft: rgba(162, 129, 85, .26);
  --gsh-inset: rgba(0, 0, 0, .28);
  --gsh-head:  'Press Start 2P', 'Courier New', monospace;
  --gsh-body:  'VT323', 'Courier New', monospace;
  --gsh-tome:  'New Rocker', 'Press Start 2P', serif;
  font-family: var(--gsh-body);
  color: var(--gsh-ink);
}

/* square, everywhere: a rounded corner is the loudest tell of the old
   chrome (framed-skin.css says the same about --radius) */
body.embedded [class^="gsh-"],
body.embedded [class*=" gsh-"],
body.embedded .gsh-field input,
body.embedded .gsh-field textarea { border-radius: 0 !important; }

body.embedded .gsh-title { color: var(--gsh-ink); }
body.embedded .gsh-handle { border-bottom: 1px solid var(--gsh-line); }

/* type: the tome for headings, bitmap for labels, VT323 for reading.
   VT323 renders small, so body sizes go UP rather than down. */
body.embedded .gsh-section-label {
  font-family: var(--gsh-head); font-size: 9px; font-weight: 400;
  letter-spacing: .06em; color: var(--gsh-gold); text-transform: uppercase;
}
body.embedded .gsh-note,
body.embedded .gsh-blurb,
body.embedded .gsh-empty,
body.embedded .gsh-msg,
body.embedded .gsh-toggle span,
body.embedded .gsh-chat-msg { font-family: var(--gsh-body); font-size: 16px; line-height: 1.35; }
body.embedded .gsh-note,
body.embedded .gsh-empty { color: var(--gsh-sub); font-style: normal; }
body.embedded .gsh-blurb { color: var(--gsh-ink); opacity: .9; }

/* rows and tiles: an inset in the parchment's own dark, hairline in gold */
body.embedded .gsh-row,
body.embedded .gsh-tile,
body.embedded .gsh-chat-log {
  background: var(--gsh-inset);
  border: 1px solid var(--gsh-line-soft);
}
body.embedded .gsh-row-name { font-family: var(--gsh-body); font-size: 17px; font-weight: 400; color: var(--gsh-ink); }
body.embedded .gsh-row-sub,
body.embedded .gsh-row-rank,
body.embedded .gsh-tile-key { font-family: var(--gsh-head); font-size: 8px; letter-spacing: .04em; color: var(--gsh-faint); }
body.embedded .gsh-tile-val { font-family: var(--gsh-head); font-size: 13px; color: var(--gsh-ink); }
body.embedded .gsh-chip {
  font-family: var(--gsh-head); font-size: 8px; letter-spacing: .04em;
  border: 1px solid var(--gsh-line); color: var(--gsh-gold); padding: 4px 7px;
}

/* buttons: the rail's chip, flat brass on dark with a hard shadow — never
   the gold gradient pill, which is the Warm Night tell */
body.embedded .gsh-cta {
  font-family: var(--gsh-head); font-size: 11px; letter-spacing: .04em;
  color: #e8c675;
  background: #1a1008;
  border: 3px solid #8a6d2f;
  box-shadow: 3px 3px 0 #000, inset 0 2px 0 rgba(232, 198, 117, .3), inset 0 -3px 0 rgba(0, 0, 0, .5);
  padding: 11px 16px;
  image-rendering: pixelated;
}
body.embedded .gsh-cta:active { transform: translateY(2px); box-shadow: 3px 1px 0 #000, inset 0 2px 0 rgba(232, 198, 117, .3); }
body.embedded .gsh-cta--ghost {
  background: transparent; color: var(--gsh-sub);
  border: 3px solid var(--gsh-line-soft); box-shadow: none;
}
body.embedded .gsh-cta--danger {
  background: #1a0a08; color: #d98a7a; border-color: #7a3b2f; box-shadow: none;
}
body.embedded .gsh-cta--sm { font-size: 9px; padding: 7px 10px; border-width: 2px; box-shadow: 2px 2px 0 #000; }
body.embedded .gsh-cta:disabled { opacity: .5; box-shadow: none; }

/* fields: a dark slot with a gold hairline, bitmap label */
body.embedded .gsh-field label { font-family: var(--gsh-head); font-size: 8px; letter-spacing: .04em; color: var(--gsh-gold); }
body.embedded .gsh-field input[type="text"],
body.embedded .gsh-field textarea,
body.embedded .gsh-chat-row input {
  background: var(--gsh-inset); border: 1px solid var(--gsh-line);
  color: var(--gsh-ink); font-family: var(--gsh-body); font-size: 17px;
}
body.embedded .gsh-divider { font-family: var(--gsh-head); font-size: 8px; color: var(--gsh-faint); }
body.embedded .gsh-divider::before,
body.embedded .gsh-divider::after { background: var(--gsh-line-soft); }
body.embedded .gsh-chat-handle { color: var(--gsh-gold); }
body.embedded .gsh-chat-text { color: var(--gsh-ink); }
body.embedded .gsh-msg--pend { color: var(--gsh-gold); }
body.embedded .gsh-guild-logo { border: 2px solid var(--gsh-line); }
body.embedded .gsh-toggle input { accent-color: var(--gsh-gold); }

.gsh-backdrop {
  position: fixed; inset: 0; z-index: 340;
  background: rgba(6, 4, 12, 0.6);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none; transition: opacity .22s ease;
}
.gsh-backdrop.show { opacity: 1; pointer-events: auto; }

.gsh-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 341;
  max-height: 90vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: var(--hg-frame-bg, linear-gradient(180deg, rgba(36,30,48,.94), rgba(18,14,26,.97)));
  border-top: var(--hg-frame-border, 1px solid rgba(212,166,75,.28));
  border-radius: 18px 18px 0 0;
  box-shadow: var(--hg-frame-shadow, 0 -18px 48px rgba(0,0,0,.55));
  -webkit-backdrop-filter: blur(var(--hg-frame-blur, 16px)); backdrop-filter: blur(var(--hg-frame-blur, 16px));
  transform: translateY(102%); transition: transform .26s cubic-bezier(.32,.72,.33,1);
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
}
.gsh-sheet.show { transform: translateY(0); }
@media (min-width: 720px) {
  .gsh-sheet { left: 50%; right: auto; width: 640px; transform: translate(-50%, 102%); }
  .gsh-sheet.show { transform: translate(-50%, 0); }
}

.gsh-handle {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px 10px;
  background: inherit;
  border-bottom: 1px solid rgba(212,166,75,.14);
}
.gsh-title {
  font-family: 'Cinzel', serif; font-weight: 900; letter-spacing: 2px;
  font-size: 15px; color: var(--hg-gold-2, #f0d28a);
  text-shadow: 0 2px 10px rgba(0,0,0,.6);
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.gsh-close {
  border: none; background: rgba(255,255,255,.06); color: var(--hg-sub, #bdb2a0);
  width: 44px; height: 44px; border-radius: 50%; font-size: 16px; cursor: pointer;
}

.gsh-accent-bar { height: 3px; border-radius: 2px; margin: 0 16px; }

/* Guild coin logo + GM line (#2404) */
.gsh-guild-logo {
  display: block; width: 56px; height: 56px; object-fit: cover;
  border-radius: 12px; margin: 12px auto 0;
  border: 1px solid var(--hg-line, rgba(255, 255, 255, .14));
  background: rgba(0, 0, 0, .35);
}
.gsh-gm-line { text-align: center; margin: 6px 16px 0; }
.gsh-coin-icon {
  width: 18px; height: 18px; object-fit: cover; border-radius: 5px;
  vertical-align: -4px; margin-right: 6px;
}

.gsh-section { padding: 14px 16px 4px; }
.gsh-section-label {
  font-family: 'Cinzel', serif; font-size: 10px; font-weight: 700;
  letter-spacing: 2px; color: var(--hg-sub, #bdb2a0); margin-bottom: 8px;
  text-transform: uppercase;
}
.gsh-blurb { font-size: 13px; color: var(--hg-ink, #f3ecdd); opacity: .85; line-height: 1.45; margin: 2px 16px 0; }

.gsh-tiles { display: flex; gap: 8px; padding: 12px 16px 2px; }
.gsh-tile {
  flex: 1; text-align: center; padding: 10px 6px; border-radius: 12px;
  background: rgba(255,255,255,.04); border: 1px solid rgba(212,166,75,.16);
}
.gsh-tile-val {
  font-variant-numeric: tabular-nums; font-family: ui-monospace, 'SFMono-Regular', monospace;
  font-size: 16px; font-weight: 700; color: var(--hg-ink, #f3ecdd);
}
.gsh-tile-key { font-size: 9px; letter-spacing: 1.5px; color: var(--hg-faint, #8b8170); margin-top: 3px; text-transform: uppercase; }

.gsh-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 10px; margin-bottom: 6px;
  background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.06);
}
.gsh-row-rank { font-family: ui-monospace, monospace; font-size: 11px; color: var(--hg-faint, #8b8170); width: 20px; text-align: right; }
.gsh-row-name { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; color: var(--hg-ink, #f3ecdd); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gsh-row-sub { font-family: ui-monospace, monospace; font-variant-numeric: tabular-nums; font-size: 11px; color: var(--hg-sub, #bdb2a0); }
/* "online · <place>" on its own line under the name (#2783 slice 3,
   FR3 B). Beside the Infamy line it shared the name's room, and in the
   desktop Guild window that cut both to an ellipsis (the served look,
   2026-10-18). Under the name, the name keeps its line whole and the mark
   cuts to an ellipsis inside the name's width; a row with no mark is one
   line, as before */
.gsh-row-online {
  display: block; margin-top: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.gsh-row-online[hidden] { display: none; }
.gsh-chip {
  font-size: 9px; letter-spacing: 1px; padding: 3px 8px; border-radius: 999px;
  border: 1px solid rgba(212,166,75,.35); color: var(--hg-gold-2, #f0d28a); text-transform: uppercase;
}

.gsh-cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: 11px; border: none; cursor: pointer;
  font-family: 'Cinzel', serif; font-weight: 700; letter-spacing: 1.2px; font-size: 12px;
  color: #140e06;
  background: linear-gradient(180deg, var(--hg-gold-2, #f0d28a), var(--hg-gold, #D4A64B));
  box-shadow: 0 6px 22px rgba(212,166,75,.35), 0 0 0 1px rgba(255,255,255,.22) inset;
}
.gsh-cta:disabled { opacity: .45; cursor: default; box-shadow: none; }
.gsh-cta--ghost {
  background: rgba(255,255,255,.05); color: var(--hg-sub, #bdb2a0);
  border: 1px solid rgba(255,255,255,.14); box-shadow: none;
}
.gsh-cta--danger {
  background: rgba(224,60,49,.12); color: #e88; border: 1px solid rgba(224,60,49,.3); box-shadow: none;
}
.gsh-cta--sm { padding: 6px 12px; font-size: 10px; border-radius: 8px; }
.gsh-cta-row { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 0 10px; }

.gsh-field { margin-bottom: 10px; }
.gsh-field label {
  display: block; font-size: 9px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--hg-faint, #8b8170); margin-bottom: 4px;
}
.gsh-field input[type="text"], .gsh-field textarea {
  width: 100%; box-sizing: border-box;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12);
  border-radius: 9px; color: var(--hg-ink, #f3ecdd);
  font-family: ui-monospace, monospace; font-size: 13px; padding: 9px 11px;
}
.gsh-field input[type="color"] {
  width: 44px; height: 32px; border: 1px solid rgba(255,255,255,.14); border-radius: 8px;
  background: transparent; padding: 2px; cursor: pointer;
}
.gsh-field-inline { display: flex; align-items: center; gap: 10px; }

.gsh-note { font-size: 11px; color: var(--hg-faint, #8b8170); line-height: 1.5; margin: 4px 0 10px; }
.gsh-msg { font-size: 12px; margin: 6px 0; min-height: 15px; }
.gsh-msg--ok { color: #7fd190; }
.gsh-msg--err { color: #e88; }
.gsh-msg--pend { color: var(--hg-gold-2, #f0d28a); }

.gsh-divider {
  display: flex; align-items: center; gap: 10px; margin: 14px 0;
  color: var(--hg-faint, #8b8170); font-size: 10px; letter-spacing: 2px;
}
.gsh-divider::before, .gsh-divider::after { content: ''; flex: 1; height: 1px; background: rgba(212,166,75,.16); }

.gsh-toggle { display: flex; align-items: center; gap: 10px; padding: 4px 0 8px; cursor: pointer; }
.gsh-toggle input { accent-color: var(--hg-gold, #D4A64B); width: 16px; height: 16px; }
.gsh-toggle span { font-size: 12px; color: var(--hg-ink, #f3ecdd); }

.gsh-empty { font-size: 12px; font-style: italic; color: var(--hg-faint, #8b8170); padding: 4px 0 8px; }

/* ── Guild chat ── */
.gsh-chat-log {
  max-height: 180px; min-height: 60px; overflow-y: auto;
  background: rgba(0,0,0,.22); border: 1px solid rgba(255,255,255,.07);
  border-radius: 10px; padding: 8px 10px; margin-bottom: 8px;
}
.gsh-chat-msg { font-size: 12px; line-height: 1.5; margin-bottom: 3px; word-break: break-word; }
.gsh-chat-handle { color: var(--hg-gold-2, #f0d28a); font-weight: 600; }
.gsh-chat-text { color: var(--hg-ink, #f3ecdd); }
.gsh-chat-row { display: flex; gap: 8px; padding-bottom: 8px; }
.gsh-chat-row input {
  flex: 1; box-sizing: border-box;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12);
  border-radius: 9px; color: var(--hg-ink, #f3ecdd);
  font-family: ui-monospace, monospace; font-size: 13px; padding: 9px 11px;
}
/* #3222 S1: why a line was not sent (a restrict, a guest, a failed check),
   said in the log in the note's colour, and the box off while it stands */
.gsh-chat-msg--system { color: var(--hg-faint, #8b8170); }
body.embedded .gsh-chat-msg--system { color: var(--gsh-sub); }
.gsh-chat-row input:disabled,
.gsh-chat-row button:disabled { opacity: .6; cursor: not-allowed; }

/* ── Dashboard "Your guild" card (replaces the raw tag input when the flag is on) ── */
.gsh-dash-card {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px; border-radius: 12px; margin-top: 4px;
  background: rgba(255,255,255,.03); border: 1px solid rgba(212,166,75,.18);
  cursor: pointer;
}
.gsh-dash-main { flex: 1; min-width: 0; }
.gsh-dash-name { font-size: 13px; font-weight: 700; color: var(--hg-ink, #f3ecdd); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gsh-dash-sub { font-size: 10px; color: var(--hg-faint, #8b8170); margin-top: 2px; letter-spacing: .5px; }
.gsh-dash-open {
  font-family: 'Cinzel', serif; font-weight: 700; font-size: 10px; letter-spacing: 1.5px;
  color: var(--hg-gold-2, #f0d28a); border: 1px solid rgba(212,166,75,.35);
  padding: 7px 12px; border-radius: 9px; background: rgba(212,166,75,.08); white-space: nowrap;
}

/* ── the empty state, drawn (#2557, 2026-09-22) ──────────────────────
   Ghost rows under the connect copy: the shape of a guild once you are in
   one (crest, name, members), quiet, not pressable. */
.gsh-ghosts { opacity: .55; }
.gsh-ghost { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border: 2px dashed rgba(90, 67, 40, .45); margin: 0 0 6px; }
.gsh-ghost-crest { padding: 10px 6px; }
.gsh-ghost-sq { width: 40px; height: 40px; flex: none; border: 2px dashed rgba(90, 67, 40, .55); }
.gsh-ghost-dot { width: 16px; height: 16px; flex: none; border-radius: 50%; border: 2px dashed rgba(90, 67, 40, .55); }
.gsh-ghost-line { height: 8px; flex: 1 1 0; max-width: 60%; background: rgba(90, 67, 40, .18); }
.gsh-ghost-line--w { max-width: 45%; height: 12px; }
body.embedded .gsh-ghost, body.embedded .gsh-ghost-sq, body.embedded .gsh-ghost-dot { border-color: rgba(90, 67, 40, .45); }
/* ...and in the HUD pass's slate window, one line instead (#3069 S13,
   GLD-1 / C17): the ghosts read as a loader that hung there. The body
   carries `hud-v2` only in that window, so everywhere else the ghosts stay
   and the line is not drawn (its gold on parchment was 1.1:1). */
.gsh-no-guild { display: none; }
body.hud-v2 .gsh-no-guild { display: block; }
body.hud-v2 .gsh-ghosts { display: none; }
