/*
 * DayFlipping application theme
 *
 * This layer changes visual language only. The compact, edge-to-edge screener
 * and crafting layouts remain owned by styles.css.
 */
:root {
  --bg: #060707;
  --surface: #0b0e0e;
  --surface-2: #101313;
  --surface-3: #171a18;
  --line: #3b2d19;
  --line-soft: #241d13;
  --text: #f2eadb;
  --muted: #9c978d;
  --gold: #eeb845;
  --gold-soft: rgba(238, 184, 69, 0.11);
  --green: #64d77b;
  --green-soft: rgba(52, 187, 93, 0.14);
  --red: #ef6559;
  --red-soft: rgba(221, 77, 66, 0.14);
  --blue: #6fa8dd;
  --radius: 8px;
  --brand-gold-bright: #fff0b1;
  --brand-gold-mid: #eeb845;
  --brand-gold-deep: #a95c08;
  --brand-panel: #0b0e0e;
  --brand-control: #101412;
  --brand-border: rgba(222, 154, 40, 0.30);
  --brand-border-strong: rgba(238, 184, 69, 0.55);
}

html {
  background: var(--bg);
  scrollbar-color: #60400f #080a09;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "Segoe UI", sans-serif;
}

::selection {
  color: #140c02;
  background: var(--brand-gold-mid);
}

:focus-visible {
  outline: 2px solid var(--brand-gold-bright);
  outline-offset: 2px;
}

/* One compact application header—not the marketing-site navigation. */
.site-header {
  isolation: isolate;
  overflow: hidden;
  border-bottom-color: rgba(213, 135, 15, 0.66);
  background: #050606;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.42), inset 0 -1px 0 rgba(255, 215, 126, 0.08);
  backdrop-filter: none;
}

.site-header::before,
.site-header::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.site-header::before {
  z-index: -2;
  background: #050606 url("brand/grand-exchange-header.webp") center / cover no-repeat;
  opacity: 0.96;
}

.site-header::after {
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(3, 4, 4, 0.95) 0%, rgba(3, 4, 4, 0.76) 35%, rgba(3, 4, 4, 0.55) 63%, rgba(3, 4, 4, 0.75) 100%),
    linear-gradient(180deg, rgba(2, 3, 3, 0.30), rgba(2, 3, 3, 0.78)),
    linear-gradient(90deg, transparent 0%, rgba(238, 184, 69, 0.48) 14%, rgba(238, 184, 69, 0.13) 50%, rgba(238, 184, 69, 0.48) 86%, transparent 100%) bottom / 100% 1px no-repeat;
}

.site-header > * {
  position: relative;
  z-index: 1;
}

.header-tool-context {
  gap: 7px;
}

.header-tool-title h1 {
  color: transparent;
  background: linear-gradient(180deg, var(--brand-gold-bright), #e7bd62 56%, #a96a16);
  background-clip: text;
  -webkit-background-clip: text;
  font-family: "Cinzel", Georgia, serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.015em;
  line-height: 1.05;
  text-transform: uppercase;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.68);
}

.header-tool-title span {
  color: #eda91d;
  font-size: 8px;
  letter-spacing: 0.13em;
}

.header-metrics {
  gap: 0;
}

.header-metrics > div {
  position: relative;
  min-width: 78px;
  padding: 0 11px;
}

.header-metrics > div:first-child {
  padding-left: 0;
}

.header-metrics > div + div::before {
  content: "";
  position: absolute;
  top: 1px;
  bottom: 1px;
  left: 0;
  width: 1px;
  background: linear-gradient(transparent, rgba(224, 160, 53, 0.30), transparent);
}

.header-metrics strong {
  color: #f4ead7;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 5px #000;
}

.header-metrics small {
  color: #918878;
  font-size: 7px;
}

.header-brand {
  gap: 1px;
}

.header-brand-link {
  min-height: 43px;
}

.brand-logo {
  width: clamp(158px, 15vw, 205px);
  height: auto;
  max-height: 44px;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(213, 135, 15, 0.32));
}

.game-selector {
  border-color: rgba(231, 178, 82, 0.34);
  background: rgba(6, 7, 6, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 223, 147, 0.08);
}

.game-option {
  color: #9c9280;
  text-shadow: 0 1px 4px #000;
}

.game-option:hover {
  color: #fff2d7;
}

.game-option.active {
  color: #1b1408;
  background: linear-gradient(180deg, var(--brand-gold-mid), #a5701a);
  text-shadow: none;
}

.header-population {
  color: #9c9280;
  text-shadow: 0 1px 4px #000;
}

.header-population span {
  color: #fff2d7;
}

.header-population b,
.header-population:hover,
.header-population:focus-visible {
  color: var(--brand-gold-mid);
}

.view-navigation {
  gap: 8px;
}

.view-navigation button,
.view-navigation a {
  min-height: 44px;
  padding: 0 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid rgba(203, 146, 47, 0.22);
  border-radius: 6px;
  color: #c5bba9;
  background: rgba(7, 9, 9, 0.70);
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.28);
}

.view-navigation svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.view-navigation button:hover {
  color: var(--brand-gold-bright);
  border-color: var(--brand-border-strong);
  background: rgba(126, 75, 7, 0.16);
}

.view-navigation button.active,
.quick-chart-button.active {
  color: #f8cd66;
  border-color: rgba(238, 184, 69, 0.62);
  background: linear-gradient(180deg, rgba(129, 80, 9, 0.35), rgba(55, 34, 6, 0.28));
  box-shadow: inset 0 0 18px rgba(222, 139, 18, 0.12), 0 0 14px rgba(222, 139, 18, 0.10);
}

#market-view,
.recipe-view {
  background: #050606;
}

.market-shell,
.recipe-shell {
  background: var(--brand-panel);
}

/* Primary controls retain their compact geometry, now using the brand materials. */
.toolbar,
.recipe-search-row {
  border-bottom-color: var(--line-soft);
  background: #080a09;
  box-shadow: inset 0 1px 0 rgba(255, 232, 175, 0.025);
}

.search-box,
select,
.filter-toggle,
.recipe-level-field input,
.recipe-reset {
  border-color: var(--brand-border);
  border-radius: 6px;
  color: var(--text);
  background-color: var(--brand-control);
  box-shadow: inset 0 1px 0 rgba(255, 236, 190, 0.025), inset 0 -8px 18px rgba(0, 0, 0, 0.18);
}

.search-box {
  color: #9e927e;
  background: linear-gradient(180deg, #111512, #0d100f);
}

.search-box input::placeholder,
.market-watchlist-create input::placeholder,
.saved-filter-create input::placeholder {
  color: #817a6f;
}

.search-box:focus-within,
.recipe-level-field input:focus,
.recipe-search-options select:focus,
.recipe-level-field input:focus {
  border-color: var(--brand-border-strong);
  box-shadow: 0 0 0 2px rgba(238, 184, 69, 0.08), inset 0 1px 0 rgba(255, 240, 202, 0.04);
}

.filter-toggle {
  color: #a39885;
}

.filter-toggle:hover,
.filter-toggle[aria-expanded="true"],
.filter-toggle.has-filters,
.recipe-filter-toggle.active {
  color: var(--brand-gold-mid);
  border-color: var(--brand-border-strong);
  background: rgba(151, 91, 9, 0.15);
}

.filter-toggle b {
  color: #160d02;
  background: linear-gradient(180deg, #f8d171, #d98d14);
  box-shadow: 0 1px 5px #000;
}

.market-watchlist-picker-toggle {
  border-color: var(--brand-border);
  border-radius: 6px;
  color: var(--text);
  background: linear-gradient(180deg, #141711 0%, #0e120e 54%, #0a0d0b 100%);
  box-shadow: inset 0 1px 0 rgba(255, 231, 170, 0.055), inset 0 -1px 0 rgba(0, 0, 0, 0.60);
}

.market-watchlist-picker-toggle:hover,
.market-watchlist-picker-toggle[aria-expanded="true"] {
  border-color: var(--brand-border-strong);
  background: linear-gradient(180deg, #1a1b12, #10130e);
}

.watchlist-trigger-star,
.watchlist-trigger-chevron {
  color: #8b7d62;
}

.watchlist-trigger-copy small {
  color: #8c8477;
}

.market-watchlist-picker-toggle.has-selection .watchlist-trigger-star {
  color: var(--brand-gold-mid);
}

.toolbar-pagination .pagination,
.pagination {
  background: transparent;
}

.page-size-control,
.table-meta,
.recipe-search-row > div {
  color: #9a9183;
}

.pagination button {
  border-color: var(--brand-border);
  border-radius: 6px;
  color: #b0a592;
  background: #0f1210;
}

.pagination button:hover:not(:disabled),
.pagination button.active {
  color: #1b1002;
  border-color: #f0c45e;
  background: linear-gradient(180deg, #f3c55d, #d78b13);
  box-shadow: inset 0 1px 0 rgba(255, 250, 223, 0.46), 0 0 10px rgba(213, 135, 15, 0.16);
}

.table-meta {
  border-bottom-color: rgba(211, 145, 35, 0.18);
  background: #0a0c0b;
}

.table-config-toggle {
  border-color: var(--brand-border);
  color: #978c79;
  background: #11130f;
}

.table-config-toggle:hover,
.table-config-toggle[aria-expanded="true"] {
  color: var(--brand-gold-mid);
  border-color: var(--brand-border-strong);
  background: var(--gold-soft);
}

.table-config-menu,
.market-watchlist-menu,
.row-watchlist-popover,
.saved-filter-menu,
.filter-popover {
  border-color: rgba(203, 148, 54, 0.38);
  color: var(--text);
  background: #0b0e0c;
  box-shadow: 0 20px 54px rgba(0, 0, 0, 0.72), inset 0 1px 0 rgba(255, 229, 163, 0.04);
}

.table-config-heading,
.saved-filter-heading,
.row-watchlist-heading,
.filter-section-heading {
  border-bottom-color: var(--line-soft);
  background: linear-gradient(180deg, #15170f, #0d100c);
}

.table-config-option:hover,
.market-watchlist-option:hover {
  background: #171811;
}

.table-config-reset {
  border-top-color: var(--line-soft);
  color: #a49a88;
  background: #10120e;
}

.table-config-reset:hover {
  color: var(--brand-gold-mid);
  background: var(--gold-soft);
}

/* Spreadsheet region: warm ink, restrained gold rules, unchanged column geometry. */
thead {
  color: #c9b992;
  background: #10130f;
  box-shadow: 0 1px 0 var(--brand-gold-mid), 0 6px 18px rgba(0, 0, 0, 0.22);
}

th {
  color: #c4b590;
}

.market-table thead > tr:first-child > th:not(:last-child),
.recipe-table thead > tr > th:not(:last-child) {
  border-right-color: rgba(202, 151, 61, 0.14);
}

th button:hover,
th button.active,
.market-header-cell [data-sort].active span,
.recipe-table th button.active span {
  color: #f2bd3e;
}

.market-header-cell[draggable="true"]::before,
.recipe-header-cell[draggable="true"]::before {
  background-image: radial-gradient(circle, #a68245 1.35px, transparent 1.6px);
}

.column-filter-row {
  background: #0b0e0c;
  box-shadow: inset 0 1px 0 var(--line-soft), 0 1px 0 var(--brand-gold-mid);
}

.column-filter-row th {
  border-top-color: rgba(203, 148, 54, 0.16);
}

.header-filter-control {
  border-color: var(--brand-border);
  background: #10130f;
}

.header-filter-control input,
.header-access-filter select,
.market-watchlist-create input,
.saved-filter-create input,
.filter-field-inputs input,
.filter-field-inputs select,
.filter-popover-save input {
  border-color: var(--brand-border);
  color: var(--text);
  background: #080a09;
}

.header-filter-control input:focus,
.header-access-filter select:focus,
.market-watchlist-create input:focus,
.filter-field-inputs input:focus,
.filter-field-inputs select:focus,
.filter-popover-save input:focus {
  border-color: var(--brand-border-strong);
}

.saved-filter-toggle {
  border-color: var(--brand-border);
  background: linear-gradient(180deg, #16180f, #0e100c);
}

.saved-filter-toggle:hover {
  border-color: var(--brand-border-strong);
  background: linear-gradient(180deg, #1d2013, #0e100c);
}

.saved-filter-toggle[aria-expanded="true"],
.saved-filter-toggle.has-selection {
  border-color: var(--brand-border-strong);
  color: var(--brand-gold-bright);
  background: var(--gold-soft);
}

tbody tr {
  background: #0b0e0e;
}

tbody tr:nth-child(odd) {
  background: #0f1211;
}

tbody tr:hover {
  background: #171a17;
  box-shadow: inset 2px 0 0 rgba(238, 184, 69, 0.58);
}

td {
  border-bottom-color: rgba(197, 144, 54, 0.16);
}

.item-cell strong,
.recipe-product strong {
  color: #f0d897;
  font-weight: 700;
}

.item-cell small,
.recipe-product small,
.value-sub {
  color: #9a9285;
}

.previous-price {
  color: #c2b69f;
}

.watch-button {
  color: #8e8067;
}

.watch-button:hover,
.watch-button.watched {
  color: var(--brand-gold-mid);
  background: rgba(238, 184, 69, 0.08);
}

.change-badge {
  border: 1px solid transparent;
  border-radius: 999px;
}

.change-badge.positive {
  border-color: rgba(83, 201, 115, 0.10);
}

.change-badge.negative {
  border-color: rgba(229, 91, 80, 0.11);
}

.member-badge {
  border-color: rgba(197, 144, 54, 0.28);
  border-radius: 4px;
  color: #b8a98d;
}

.member-badge.member {
  color: #e7b74f;
  border-color: rgba(238, 184, 69, 0.34);
  background: rgba(116, 74, 10, 0.13);
}

.recipe-filter-grid {
  border-bottom-color: var(--line-soft);
  background: #080a09;
}

.recipe-input {
  border-color: rgba(201, 149, 62, 0.26);
  border-radius: 5px;
  color: #d4c7b0;
  background: #11140f;
}

.recipe-skill-badge {
  border: 1px solid rgba(211, 151, 47, 0.24);
  border-radius: 5px;
  color: #e2c47b;
  background: rgba(123, 78, 10, 0.14);
}

.loading span {
  background: var(--brand-gold-mid);
}

@media (max-width: 1120px) {
  .site-header {
    gap: 12px;
  }

  .header-tool-title h1 {
    font-size: 17px;
  }

  .header-tool-title span {
    display: none;
  }

  .header-metrics > div {
    min-width: 66px;
    padding-inline: 8px;
  }

  .brand-logo {
    width: 160px;
  }

  .view-navigation button {
    padding-inline: 10px;
  }
}

@media (max-width: 760px) {
  .site-header {
    padding: 8px 10px;
  }

  .brand-logo {
    width: 124px;
  }

  .header-tool-title h1 {
    font-size: 15px;
  }

  .header-metrics > div {
    min-width: 56px;
    padding-inline: 6px;
  }

  .header-metrics strong {
    font-size: 11px;
  }

  .header-metrics small {
    font-size: 6px;
  }

  .view-navigation {
    display: flex;
  }

  .view-navigation button {
    width: 40px;
    min-height: 40px;
    padding: 0;
  }

  .view-navigation .nav-label {
    display: none;
  }
}

@media (max-width: 560px) {
  .site-header {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .header-metrics > div:nth-child(3) {
    display: none;
  }

  .brand-logo {
    width: 104px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
