/* ══════════════════════════════════════════════════════════════════
   REFINED — final visual layer (loads after app.css and ui.css)

   The app grew a lot of decoration: display serif on every heading,
   gold gradients on active states, glows, frosted glass, hairline
   gradients over every card. Each was fine alone; together they read
   as generic. This layer takes the decoration out and keeps the
   identity in three places only:

     • the Cinzel page title (and server names in ledgers)
     • gold for live data and the active state
     • the game art behind the header and in the sidebar

   It overrides by component, not by page, so new pages inherit it.
   ══════════════════════════════════════════════════════════════════ */

:root {
  /* Retire the display serif everywhere it was used by token; the few
     places that keep it ask for --font-brand explicitly. */
  --font-brand: 'Cinzel', 'Times New Roman', serif;
  --font-display: var(--font-ui);

  --glow-accent: none;
  --glow-crimson: none;
  --glow-red: none;
  --glow-gold: none;
  --glow-gold-sm: none;
  --glow-jade: none;
  --glow-violet: none;

  --rf-card: #12151A;
  --rf-raised: #191D24;
  --rf-line: rgba(255,255,255,.075);
  --rf-line-2: rgba(255,255,255,.12);
  --rf-gold-line: rgba(200,150,60,.5);
  --rf-gold-wash: rgba(200,150,60,.1);
}

/* ── Page header ───────────────────────────────────────────────── */
:root .topbar .breadcrumb { display: none; }
:root .page-title {
  font-family: var(--font-brand) !important;
  font-size: 26px !important;
  font-weight: 700 !important;
  letter-spacing: .015em !important;
  color: var(--text-strong) !important;
  text-shadow: none !important;
}
:root .page-title-accent { color: inherit !important; background: none !important; -webkit-text-fill-color: currentColor !important; }
:root .page-sub {
  margin-top: 6px;
  color: var(--text-muted) !important;
  font-size: var(--fs-sm) !important;
  letter-spacing: normal !important;
}

/* ── Cards ─────────────────────────────────────────────────────── */
:root .card,
:root .home-tile,
:root .profile-card {
  background: var(--rf-card) !important;
  border: 1px solid var(--rf-line) !important;
  border-radius: 8px !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}
:root .card::before,
:root .home-tile::before,
:root .profile-card::before { display: none !important; }
:root .card-header,
:root .home-tile-header {
  background: none !important;
  border-bottom: 1px solid var(--rf-line) !important;
}
:root .card-title,
:root .home-tile-title,
:root .card h2,
:root .card h3 {
  font-family: var(--font-ui) !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  letter-spacing: normal !important;
  color: var(--text) !important;
  text-shadow: none !important;
}

/* Small captions that used to be spaced-out caps: labels, eyebrows,
   stat names, table heads. Sentence case, quiet, one size. */
:root label,
:root .input-label,
:root .stat-label,
:root .nav-label,
:root [class*="eyebrow"],
:root .tbl th,
:root table th {
  font-family: var(--font-ui) !important;
  letter-spacing: normal !important;
}
:root .input-label,
:root .stat-label,
:root [class*="eyebrow"] {
  font-size: var(--fs-xs) !important;
  font-weight: 500 !important;
  color: var(--text-dim) !important;
}
:root .tbl th,
:root table th {
  font-size: var(--fs-xs) !important;
  font-weight: 500 !important;
  color: var(--text-dim) !important;
}
:root td { font-variant-numeric: tabular-nums; }

/* ── Sidebar ───────────────────────────────────────────────────── */
:root .nav-label {
  font-size: 11px !important;
  font-weight: 600 !important;
  color: var(--text-disabled) !important;
}
:root .nav-label::before,
:root .nav-label::after { display: none !important; }
/* The active item is the one place glass stays: a frosted pane over the
   sidebar art, lit from the top edge and warmed with gold from the left. */
:root .nav-item.active {
  color: var(--text-strong) !important;
  background:
    linear-gradient(90deg, rgba(240,192,96,.24), rgba(240,192,96,.05) 60%, transparent),
    linear-gradient(180deg, rgba(255,255,255,.09), rgba(255,255,255,.03)) !important;
  border: 1px solid rgba(255,255,255,.14) !important;
  border-top-color: rgba(255,255,255,.3) !important;
  border-left-color: rgba(240,192,96,.45) !important;
  border-radius: 8px !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.12),
    0 0 16px rgba(240,192,96,.12),
    0 6px 18px rgba(0,0,0,.4) !important;
  -webkit-backdrop-filter: blur(14px) saturate(150%) !important;
  backdrop-filter: blur(14px) saturate(150%) !important;
}
:root .nav-item:not(.active):hover {
  background: rgba(255,255,255,.04) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  backdrop-filter: blur(10px) !important;
}
:root .nav-item.active::before {
  background: var(--gold-bright) !important;
  height: 18px !important;
  top: 50% !important;
  transform: translateY(-50%);
  border-radius: 2px;
}
:root .nav-item.active .nav-icon { color: var(--gold-bright) !important; }

/* ── Tabs: underline, not lozenges ─────────────────────────────── */
/* The shared travelling indicator (ui.css) becomes the underline, so
   tab switches keep their motion without the gold lozenge. */
:root .tabs.ui-tabs-slide,
:root .ui-tabs-slide {
  background: none !important;
  border: 0 !important;
  border-bottom: 1px solid var(--rf-line) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
:root .ui-tab-ind {
  top: auto !important;
  bottom: -1px !important;
  height: 2px !important;
  border-radius: 2px !important;
  background: var(--gold-bright) !important;
  box-shadow: none !important;
}
:root .ui-tabs-slide :is(.tab, .plr-tab, .checklist-tab, .mkt-tab, .ai-tab, .admin-tab).active {
  box-shadow: none !important;
  border-color: transparent !important;
}
:root :is(.plr-tab, .checklist-tab, .mkt-tab, .ai-tab, .admin-tab) {
  font-family: var(--font-ui) !important;
  letter-spacing: normal !important;
}
:root :is(.plr-tab, .checklist-tab, .mkt-tab, .ai-tab, .admin-tab).active { color: var(--text-strong) !important; }
:root .tab {
  font-family: var(--font-ui) !important;
  font-size: var(--fs-sm) !important;
  font-weight: 500 !important;
  letter-spacing: normal !important;
  color: var(--text-muted) !important;
  background: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}
:root .tab:hover { color: var(--text) !important; }
:root .tab.active {
  color: var(--text-strong) !important;
  box-shadow: inset 0 -2px 0 var(--gold-bright) !important;
}

/* ── Pills / filter chips ──────────────────────────────────────── */
:root .pill {
  font-family: var(--font-ui) !important;
  font-size: var(--fs-sm) !important;
  font-weight: 500 !important;
  letter-spacing: normal !important;
  color: var(--text-muted) !important;
  background: transparent !important;
  border: 1px solid var(--rf-line-2) !important;
  border-radius: 6px !important;
  box-shadow: none !important;
}
:root .pill:hover { color: var(--text) !important; border-color: rgba(255,255,255,.2) !important; }
:root .pill.active {
  color: var(--gold-bright) !important;
  background: var(--rf-gold-wash) !important;
  border-color: var(--rf-gold-line) !important;
}

/* ── Badges ────────────────────────────────────────────────────── */
:root [class*="badge"]:not(.sr-notif-badge) {
  font-family: var(--font-ui) !important;
  letter-spacing: normal !important;
  box-shadow: none !important;
}

/* ── Buttons ───────────────────────────────────────────────────── */
:root .btn {
  font-family: var(--font-ui) !important;
  font-size: var(--fs-sm) !important;
  font-weight: 600 !important;
  letter-spacing: normal !important;
  border-radius: 6px !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  background-image: none !important;
}
:root .btn-gold {
  color: #17120A !important;
  background-color: var(--gold) !important;
  border: 1px solid transparent !important;
}
:root .btn-gold:hover:not(:disabled) { background-color: #D6A447 !important; }

/* ── Inputs: solid, not frosted ────────────────────────────────── */
:root input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
:root textarea,
:root .search-row {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

/* ── Page-specific surfaces that skipped the .card class ──────── */
:root .im-tile,
:root .wx-glass,
:root .wx-ccy-card {
  background-image: none !important;
  background-color: var(--rf-card) !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}
:root .tracker-filter-card > div { background-image: none !important; }

/* Controls and bars that were frosted glass. Sticky table heads get a
   solid fill instead so rows still can't show through. */
:root .aui-dropdown-trigger,
:root .nft-dd-btn,
:root .nft-sort-btn,
:root .tabs,
:root .mkt-tabs,
:root .bs-toolbar,
:root .bs-filter-wrap {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}
:root .tbl th,
:root table th {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}
:root thead th[style*="sticky"],
:root .tbl thead th { background-color: var(--rf-card); }

/* ── Skeletons keep their shimmer; everything else stays flat ──── */
:root .loading,
:root .spin { letter-spacing: normal !important; }

/* ── About this page (server-rendered page text for search) ─────── */
.seo-about { position: relative; z-index: 2; max-width: 860px; margin: 40px 0 24px; padding: 20px 22px;
  background: var(--rf-card, #14161d); border: 1px solid var(--bdr2, rgba(255,255,255,.08)); border-radius: 10px;
  color: var(--text2, #b6bac4); font-size: 13px; line-height: 1.6; }
.seo-about h2 { font-size: 16px; color: var(--text, #e8e9ed); margin: 0 0 8px; }
.seo-about h3 { font-size: 14px; color: var(--text, #e8e9ed); margin: 18px 0 8px; }
.seo-about p { margin: 0 0 8px; }
.seo-about dt { color: var(--text, #e8e9ed); font-weight: 600; margin-top: 10px; }
.seo-about dd { margin: 2px 0 0; }
.seo-about .seo-links { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 16px; }
.seo-about .seo-links a { color: var(--gold, #C8963C); text-decoration: none; }
.seo-about .seo-links a:hover { text-decoration: underline; }
.seo-about[hidden] { display: none; }

/* ══════════════════════════════════════════════════════════════════
   CONSISTENCY PASS

   What was left after the decoration came out was drift: seven corner
   radii on one page, frosted glass on controls with nothing behind
   them, soft drop shadows nobody can see on a near-black ground, and a
   purple neon pill on the NFT cards. This block picks one answer for
   each and applies it everywhere.

     radius   4 chips · 6 controls · 8 cards and panels
     depth    borders, not shadows; blur only where art sits behind
     primary  one solid gold button; crimson is for destructive only
     icons    the line set from homeIcon(), never a text glyph
   ══════════════════════════════════════════════════════════════════ */
:root {
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --r:  var(--radius-md);
  --rl: var(--radius-lg);
  --control-radius: var(--radius-md);
  --control-radius-inner: var(--radius-sm);
}

/* Buttons never inherited the UI face, so a few fell back to Arial. */
button, input, select, textarea { font-family: inherit; }

/* Inline icons sized by the text around them. */
.ico-1em { width: 1em; height: 1em; flex: 0 0 auto; vertical-align: -.125em; }
.ico-fill { fill: currentColor; }
.nav-item.is-fav .nav-fav-star svg { fill: currentColor; }

/* ── Radii ─────────────────────────────────────────────────────── */
:root .nav-item,
:root .sr-btn,
:root .search-row,
:root .aui-dropdown-trigger,
:root .dt-seg-btn,
:root .pill { border-radius: var(--radius-md) !important; }
:root .bs-toolbar,
:root .bs-banner,
:root .wx-glass,
:root .mkt-card,
:root .seo-about,
:root .card,
:root .home-tile,
:root .profile-card { border-radius: var(--radius-lg) !important; }
:root .card-header { border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important; }

/* ── Depth: one hairline, no haze ──────────────────────────────── */
:root select,
:root .search-row,
:root .aui-dropdown-trigger,
:root .bs-filter-wrap,
:root .bs-toolbar,
:root .bs-banner,
:root .mkt-card,
:root .mkt-skel,
:root .boss-card,
:root .sp-floor-card,
:root .home-stat,
:root .ht-card,
:root .wx-token-mark {
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}
:root .mkt-card,
:root .mkt-skel,
:root .boss-card,
:root .sp-floor-card,
:root .home-stat,
:root .ht-card {
  background-image: none !important;
  background-color: var(--rf-card) !important;
  border-color: var(--rf-line) !important;
}
:root .mkt-card:hover,
:root .home-stat:hover,
:root .ht-card:hover,
:root .im-tile:hover,
:root .wx-ccy-card:hover {
  background-image: none !important;
  background-color: var(--rf-raised) !important;
  border-color: var(--rf-line-2) !important;
}
/* The rail and sidebar sit on the page background, so their blur had
   nothing to blur. */
:root .sidebar,
:root .status-rail {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}
:root .page-title-accent { text-shadow: none !important; }

/* ── Sidebar: the active item is a tint and a marker ───────────── */
:root .nav-item.active {
  background: rgba(240,192,96,.09) !important;
  border: 1px solid transparent !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}
:root .nav-item:not(.active):hover {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}
/* Active used to jump to 700, which widened the label enough to
   truncate "Server Rankings". Colour carries the state instead. */
:root .nav-item .nav-text,
:root .nav-item.active .nav-text { font-weight: 500 !important; }
:root .nav-item.active .nav-fav-star { color: var(--text-dim) !important; }
:root .nav-item.active.is-fav .nav-fav-star { color: var(--gold) !important; }

/* ── Status rail shortcut hint ─────────────────────────────────── */
.sr-kbd { font-size: 11px; font-weight: 500; white-space: nowrap; }

/* ── Buttons ───────────────────────────────────────────────────── */
/* Crimson is the destructive button and nothing else. */
:root .btn-crimson {
  color: #FF8D99 !important;
  background-color: rgba(196,30,58,.14) !important;
  border: 1px solid rgba(196,30,58,.4) !important;
}
:root .btn-crimson:hover:not(:disabled) { color: #fff !important; background-color: rgba(196,30,58,.26) !important; }
/* Square icon button (NFT Market refresh) — was a solid red block. */
:root .nft-refresh-btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: var(--control-h); height: var(--control-h);
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--rf-line-2);
  border-radius: var(--radius-md);
  font-size: 0;
}
:root .nft-refresh-btn-icon svg { width: 16px; height: 16px; }
:root .nft-refresh-btn-icon:hover { color: var(--text); background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.2); }
.mkt-dz-icon svg { width: 28px; height: 28px; }

/* ── Spinner: a ring, not a rotating arrow character ───────────── */
:root .spin {
  display: inline-block;
  width: 12px; height: 12px; flex: 0 0 12px;
  font-size: 0 !important; line-height: 0;
  border: 1.5px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  vertical-align: -1px;
}

/* ── NFT cards: the price sits on a plain dark plate ───────────── */
:root .nft-card-price-band {
  background: rgba(10,12,16,.88) !important;
  border: 1px solid rgba(255,255,255,.14) !important;
  box-shadow: none !important;
}

/* ── Item tiles: grade is the frame colour, without the halo ───── */
:root .im-tile-img-wrap { box-shadow: inset 0 0 14px rgba(0,0,0,.35) !important; }
:root .im-tile-tier { text-shadow: none !important; }

/* ── Boss schedule: active dots are solid, not glowing ─────────── */
:root .bs-active-dot { box-shadow: none !important; }

/* The favourite star only shows on hover or when pinned, so it should
   not reserve 18px on every row; that space is what clipped the longer
   labels. It sits over the row end and the label makes room on demand. */
:root .nav-item .nav-fav-star {
  position: absolute; right: 8px; top: 50%;
  transform: translateY(-50%);
  margin: 0; padding: 0;
  display: inline-flex;
}
:root .nav-item:hover .nav-text,
:root .nav-item.is-fav .nav-text { padding-right: 18px; }

/* ══════════════════════════════════════════════════════════════════
   PHONE WIDTH

   Things that spilled or were cut off at 375px.
   ══════════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  /* Status rail: it ran 210px past the screen, leaving half a WEMIX icon
     at the edge and the clock out of sight. Now the next boss takes the
     spare width and trims with an ellipsis, the price shows as a number
     only, and the clock gives way. */
  .status-rail .sr-boss { flex: 1 1 0; min-width: 0; overflow: hidden; }
  .status-rail .sr-boss > i { display: none; }
  .status-rail .sr-boss-list { flex: 1 1 0; min-width: 0; }
  .status-rail .sr-bslot { width: auto !important; min-width: 0 !important; flex: 1 1 0; display: flex; overflow: hidden; }
  .status-rail .sr-bslot ~ .sr-bslot { display: none !important; }
  .status-rail .sr-bname { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .status-rail .sr-btime { flex: 0 0 auto; }
  .status-rail .sr-wemix { flex: 0 0 auto; padding-right: 10px; }
  .status-rail .sr-wemix > i,
  .status-rail .sr-wemix .sr-chg { display: none !important; }
  .status-rail #sr-wemix-price { min-width: 0 !important; }
  .status-rail .sr-spacer,
  .status-rail .sr-item:has(#sr-clock) { display: none !important; }

  /* Card headers with a title and controls: let the controls drop to
     their own line instead of pushing out of the card. */
  :root .card-header { flex-wrap: wrap; row-gap: 8px; }
  :root .card-header > div { flex-wrap: wrap; min-width: 0; }

  /* Tables: tighter gutters so fewer of them need sideways scrolling. */
  :root .tbl th,
  :root .tbl td { padding-left: 10px !important; padding-right: 10px !important; }
  /* Clan Rankings (rank · clan · leader · power): long names trim so the
     power score stays on screen. */
  #page-clanrank .tbl td:nth-child(2):nth-last-child(3),
  #page-clanrank .tbl td:nth-child(3):nth-last-child(2) {
    max-width: 88px; overflow: hidden; text-overflow: ellipsis;
  }

  /* Server Activity dates: the calendar icon was squeezing the year out
     of view. Tapping the field opens the calendar, so the icon can go. */
  #page-daily .dt-date { padding: 0 8px; text-align: center; }
  #page-daily .dt-date::-webkit-calendar-picker-indicator { display: none; }
  #page-daily .dt-dates-pair { gap: 6px; }
  #page-daily .dt-activity-head { flex-wrap: wrap; row-gap: 4px; }
  #page-daily .dt-sel { flex-wrap: wrap; gap: 2px 10px; }
}

/* Date and time fields were collapsing to the height of their text
   (Clan Expedition run date and time); match every other control. */
:root input[type="date"],
:root input[type="time"] { min-height: var(--control-h); }

/* ══════════════════════════════════════════════════════════════════
   MENUS: LAYER AND SURFACE

   The NFT Market sort menu opened underneath the filter buttons: its row
   and the filter row shared one z-index, so the later row painted over
   it. The row that owns an open menu now rises above its neighbours, and
   every menu panel is an opaque surface so nothing reads through it.
   ══════════════════════════════════════════════════════════════════ */
#page-nftmarket .nft-header-row { z-index: 22; }
#page-nftmarket .nft-header-row:has([data-dd].open),
#page-nftmarket .nft-filter-row:has([data-dd].open) { z-index: 40; }
#page-nftmarket [data-dd].open .nft-dd-panel { z-index: 5; }
:root .nft-dd-panel,
:root .nft-sort-panel,
:root .aui-dropdown-panel,
:root .mkt-menu-dropdown {
  background: #171C26 !important;
  background-image: none !important;
  border: 1px solid var(--rf-line-2) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: 0 12px 32px rgba(0,0,0,.55) !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

/* NFT Market toolbar on a phone: two equal columns of filters, Status on
   its own line, then the Tradable toggle with Refresh beside it. Refresh
   used to wrap onto a row of its own. Every control is one height. */
@media (max-width: 640px) {
  #page-nftmarket .nft-filter-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  #page-nftmarket .nft-dd { min-width: 0; max-width: none; width: auto; }
  #page-nftmarket .nft-dd[data-dd="status"] { grid-column: 1 / -1; }
  #page-nftmarket .nft-trade-toggle {
    grid-column: 1 / -1; grid-row: 4;
    margin-right: calc(var(--control-h) + 8px);
    justify-content: center;
  }
  #page-nftmarket .nft-refresh-btn-icon {
    grid-column: 1 / -1; grid-row: 4;
    justify-self: end;
  }
  #page-nftmarket .nft-dd-btn,
  #page-nftmarket .nft-sort-btn,
  #page-nftmarket .nft-trade-toggle,
  #page-nftmarket .nft-refresh-btn-icon { height: var(--control-h) !important; min-height: var(--control-h) !important; }
  #page-nftmarket .nft-refresh-btn-icon { width: var(--control-h); }
  /* Menus span their control and never run off the screen edge. */
  #page-nftmarket .nft-dd .nft-dd-panel { left: 0; right: 0; width: auto; min-width: 0; max-width: none; }
  #page-nftmarket .nft-sort-panel { right: 0; left: auto; max-width: calc(100vw - 32px); }
}

/* Boss toolbar switches that are off read as off: dimmed, no "on" dot. */
#page-bosses .bs-toolbar > .btn.bs-toggle.is-muted { color: var(--text-dim); }
#page-bosses .bs-toolbar > .btn.bs-toggle.is-muted .bs-ico { opacity: .55; }
.notif-perm-actions { display: inline-flex; gap: 6px; flex: 0 0 auto; }
