/* The guild site's look over the live site's tools (app.html), the
   owner's wish (2026-11-16): every tab follows the Guild page. Loaded after
   ../css/*.css, so these rules win; the live page (../index.html) never
   loads this file.

   1. The tokens: the live site's colour, radius and font settings
      (../css/tokens.css) set to the Guild page's: warm near-black instead of
      purple stone, its brighter gold, rounder cards, Inter for the interface.
      Text colours keep their checked values (tests/test_dashboard_contrast.py
      checks the overrides here too).
   2. The pieces every page shares: the background, panels as glass cards,
      the race banner without its gold frame, headings, tabs, fields.
   3. Per page: Leveling, Market, Best in Slot (more to come).
   The old masthead (the "Forever Race" banner with the live pill and the
   buttons) is hidden: the guild top bar (css/shell.css) works it. */

/* --- 1. tokens ------------------------------------------------------------------- */
:root {
  --stone-950: #090705;
  --stone-900: #0d0a07;
  --stone-850: #110e0b;
  --stone-800: #17130e;
  --stone-700: #211a12;
  --stone-600: #2e2519;
  --surface-page: #090705;
  --surface-panel: #17130e;
  --panel-top: rgba(23, 19, 14, 0.94);
  --panel-bottom: rgba(14, 11, 8, 0.97);
  --tint-row: rgba(255, 240, 210, 0.04);
  --tint-gold: rgba(242, 193, 78, 0.14);
  --gold: #f2c14e;
  --gold-bright: #ffe7a3;
  --gold-mid: #c98a2c;
  --gold-dim: #6a4a14;
  --gold-deep: #3e2a08;
  --gold-glass: rgba(242, 193, 78, 0.12);
  --gold-line: rgba(242, 193, 78, 0.34);
  --panel-line: rgba(255, 232, 190, 0.1);
  --panel-line-strong: rgba(255, 232, 190, 0.2);
  --panel-rule: rgba(255, 232, 190, 0.08);
  --radius: 12px;
  --radius-sm: 9px;
  --radius-lg: 22px;
  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-read: "Alegreya", Georgia, serif;
}

/* --- 2. the shared pieces ------------------------------------------------------------ */
body {
  background-color: #090705;
  background-image:
    radial-gradient(110% 60% at 50% -12%, rgba(242, 193, 78, 0.10), transparent 60%),
    radial-gradient(70% 45% at 8% 10%, rgba(255, 138, 43, 0.06), transparent 55%),
    linear-gradient(180deg, #0d0a07 0%, #090705 50%, #060403 100%);
  font-size: 16px;
  line-height: 1.55;
}
body::before { opacity: 0.22; }
.vignette { background: radial-gradient(120% 90% at 50% 40%, transparent 60%, rgba(0, 0, 0, 0.6) 100%); }

/* the guild top bar works the old masthead */
.masthead { display: none; }

/* page width like the Guild page, a little more air */
main.page { max-width: 1280px; }

/* panels: the Guild page's cards */
.panel {
  border: 1px solid var(--panel-line);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #17130e 0%, #110e0b 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 24px 60px -30px rgba(0, 0, 0, 0.9);
}
.panel::before {
  width: min(40%, 16rem);
  background: linear-gradient(90deg, transparent, rgba(242, 193, 78, 0.45), transparent);
}
/* the race banner and the character title band: a glass card, no gold frame or gems */
.frame-ornate {
  border: 1px solid rgba(255, 232, 190, 0.16);
  border-image: none;
  border-radius: 26px;
  background-clip: border-box;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 30px 80px -30px rgba(0, 0, 0, 0.9);
}
.frame-ornate::before,
.frame-ornate::after { display: none; }

.panel-title {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.06em;
}
.panel-title::before { display: none; }
.panel-glyph {
  border-radius: 12px;
  border-color: rgba(255, 232, 190, 0.16);
  background: rgba(242, 193, 78, 0.08);
  box-shadow: none;
}
.panel-note { font-family: var(--font-read); }

/* tab strips (Market, Best in Slot, ...): the Guild page's pill filters */
.seg-tabs {
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--panel-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  box-shadow: none;
}
.seg-tab {
  border: 0;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: none;
  background: none;
  box-shadow: none;
}
.seg-tab:hover { background: rgba(255, 255, 255, 0.06); }
.seg-tab[aria-selected="true"] {
  color: var(--text-on-gold);
  background: var(--gold);
  box-shadow: 0 0 20px rgba(242, 193, 78, 0.3);
}

/* fields */
main input[type="search"],
main input[type="text"],
main input[type="number"],
main select {
  border-radius: 10px;
  border-color: rgba(255, 232, 190, 0.16);
  background-color: rgba(255, 255, 255, 0.04);
  font-family: var(--font-body);
}

/* the status banners ("A quiet realm", "Late prices"): calmer, rounder */
.banner { border-radius: 16px; box-shadow: none; }

/* the character window's bookmark tabs (Market, Crafting, a character's sheet):
   the Guild page's pill filters instead of gold bookmarks */
.charwin-tabs {
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--panel-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  width: fit-content;
  max-width: 100%;
}
.charwin-tab {
  min-height: 2.4rem;
  margin-bottom: 0;
  padding: 0.35rem 1rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: none;
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: none;
  box-shadow: none;
  translate: none;
}
.charwin-tab:hover { border-color: transparent; background: rgba(255, 255, 255, 0.06); translate: none; }
.charwin-tab[aria-selected="true"] {
  color: var(--text-on-gold);
  border-color: var(--gold);
  background: linear-gradient(180deg, #ffe7ad, #f2c76a 55%, #e2a94e);
  box-shadow: 0 0 20px rgba(242, 193, 78, 0.3);
}

/* Best in Slot's three modes: glass cards, the chosen one lit gold */
.bis-tab {
  border: 1px solid var(--panel-line);
  border-radius: 18px;
  background: linear-gradient(180deg, #17130e, #110e0b);
}
.bis-tab:hover { border-color: var(--panel-line-strong); }
.bis-tab[aria-current="page"],
.bis-tab[aria-current="true"],
.bis-tab.is-current {
  border-color: rgba(242, 193, 78, 0.6);
  background: linear-gradient(180deg, rgba(242, 193, 78, 0.14), rgba(242, 193, 78, 0.04));
  box-shadow: 0 0 30px -10px rgba(242, 193, 78, 0.5);
}

/* the selected tab's icon: dark on the gold pill (it was gold on gold) */
.charwin-tab[aria-selected="true"] svg { filter: brightness(0) opacity(0.72); }

/* status boxes: "A quiet realm" (the top banners) and the pages' notices
   ("Late prices"): a dark glass card with a thin coloured edge on the left */
:root { --surface-banner-warn: #241b0c; }
.banner {
  border: 1px solid rgba(244, 199, 108, 0.28);
  border-left: 3px solid rgba(244, 199, 108, 0.75);
  border-radius: 14px;
  box-shadow: 0 16px 40px -24px rgba(0, 0, 0, 0.9);
}
.market-notice {
  border: 1px solid var(--panel-line);
  border-left: 3px solid rgba(242, 193, 78, 0.7);
  border-radius: 16px;
  background: linear-gradient(180deg, #17130e, #110e0b);
  box-shadow: 0 16px 40px -24px rgba(0, 0, 0, 0.9);
}
.market-notice-warn { border-left-color: rgba(244, 199, 108, 0.8); }
.market-notice-bad { border-left-color: rgba(255, 154, 144, 0.8); }

/* the page titles (Market, Best in Slot, ...): the Guild page's glass square */
.page-glyph {
  border-radius: 14px;
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}
.page-head::after { background: linear-gradient(90deg, rgba(242, 193, 78, 0.6), transparent); }

@media (max-width: 760px) {
  .charwin-tabs { border-radius: 22px; width: auto; }
}

/* --- 4. the sub-tab bar (the owner, 2026-11-17) ---------------------------------------
   The guild shell's sub-tab bar (css/subbar.css, js/app-shell.js) opens these
   pages' tabs now: their own tab rows hide (the pages still draw them, and
   js/app-shell.js presses them). The bars at the top are taller than the
   live site bar was: what sticks under them, and jumps to an anchor, keep
   clear of both (the guild top bar 64 px + the sub-tab bar 52 px; 56 + 48
   on a phone). */
.mk-tabs,
.cr-tabs,
.bis-tabs,
.it-views { display: none !important; }

html { scroll-padding-top: calc(var(--shell-h, 116px) + 8px); }
.it-side,
.ah-side { top: calc(var(--shell-h, 116px) + 12px); max-height: calc(100vh - var(--shell-h, 116px) - 24px); }
.it-th,
.ah-th { top: var(--shell-h, 116px); }
.it-row { scroll-margin-top: calc(var(--shell-h, 116px) + 56px); }
@media (max-width: 760px) {
  html { --shell-h: 104px; }
}
@media (max-width: 1100px) {
  .it-side,
  .ah-side { top: auto; max-height: none; }
}
