/* Auction Coach website. Dark "midnight" theme: deep violet night, warm
   gold for money and actions, arcane violet glows. Colours live here as
   tokens; app.js reads the chart colours from them too. */

:root {
  color-scheme: dark;

  --bg: #0b0912;
  --bg-2: #120f1c;
  --panel: rgba(25, 21, 38, 0.72);
  --panel-solid: #191526;
  --panel-2: rgba(40, 34, 58, 0.75);
  --border: rgba(255, 220, 150, 0.10);
  --border-strong: rgba(255, 209, 90, 0.28);
  --text: #f1ece3;
  --muted: #a59cb4;
  --faint: #6f6684;

  --gold: #ffd36a;
  --gold-2: #ffb547;
  --gold-deep: #b9790e;
  --violet: #9b7bff;
  --violet-2: #6b4dff;
  --teal: #4fd1c5;
  --good: #5fd38d;
  --warn: #f5b04a;
  --bad: #ff6b6b;
  --blue: #6aa7ff;

  --chart-grid: rgba(255, 255, 255, 0.06);
  --chart-tick: #8f86a3;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.8);
  --glow-gold: 0 0 0 1px rgba(255, 211, 106, 0.35), 0 10px 40px -10px rgba(255, 181, 71, 0.45);

  --font-display: "Cinzel", "Trajan Pro", Georgia, serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Night sky: a gold glow up top, violet below, faint stars and a fine grid. */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(900px 500px at 50% -120px, rgba(255, 190, 80, 0.16), transparent 70%),
    radial-gradient(700px 600px at 0% 100%, rgba(107, 77, 255, 0.16), transparent 70%),
    radial-gradient(600px 500px at 100% 40%, rgba(79, 209, 197, 0.07), transparent 70%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
}
.backdrop::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 12% 18%, rgba(255, 255, 255, 0.55), transparent 60%),
    radial-gradient(1px 1px at 78% 12%, rgba(255, 255, 255, 0.45), transparent 60%),
    radial-gradient(1.5px 1.5px at 62% 34%, rgba(255, 230, 170, 0.5), transparent 60%),
    radial-gradient(1px 1px at 30% 62%, rgba(255, 255, 255, 0.35), transparent 60%),
    radial-gradient(1px 1px at 88% 72%, rgba(255, 255, 255, 0.4), transparent 60%),
    radial-gradient(1.5px 1.5px at 45% 86%, rgba(200, 180, 255, 0.45), transparent 60%),
    radial-gradient(1px 1px at 6% 80%, rgba(255, 255, 255, 0.35), transparent 60%);
  animation: twinkle 7s ease-in-out infinite alternate;
}
.backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 70%);
}
@keyframes twinkle { from { opacity: 0.55; } to { opacity: 1; } }

a { color: var(--gold); text-decoration: none; }
a:hover { color: #fff1c4; }

::selection { background: rgba(255, 211, 106, 0.3); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 6px; }

/* ---------------------------------------------------------------- header */

.top {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 9, 18, 0.7);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--border);
}
.top-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.brand:hover { color: var(--text); }
.crest {
  width: 34px;
  height: 34px;
  filter: drop-shadow(0 0 10px rgba(255, 190, 70, 0.45));
  transition: transform 0.4s cubic-bezier(.2, .8, .2, 1.4);
}
.brand:hover .crest { transform: rotate(-12deg) scale(1.06); }
.brand-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.brand-text span, .gold-text {
  background: linear-gradient(180deg, #fff3c9 0%, var(--gold) 45%, var(--gold-2) 70%, var(--gold-deep) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nav { display: flex; gap: 4px; margin-right: auto; }
.nav a {
  color: var(--muted);
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s, background 0.2s;
}
.nav a:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.nav a.active { color: var(--gold); background: rgba(255, 211, 106, 0.1); box-shadow: inset 0 0 0 1px rgba(255, 211, 106, 0.22); }

.top-right { display: flex; align-items: center; gap: 12px; }

.live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--muted);
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(95, 211, 141, 0.06);
  white-space: nowrap;
}
.live .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 0 rgba(95, 211, 141, 0.6);
  animation: pulse 2.2s infinite;
}
.live.stale { background: rgba(245, 176, 74, 0.08); }
.live.stale .dot { background: var(--warn); animation: none; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(95, 211, 141, 0.55); }
  70% { box-shadow: 0 0 0 9px rgba(95, 211, 141, 0); }
  100% { box-shadow: 0 0 0 0 rgba(95, 211, 141, 0); }
}

.realm {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--gold);
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 4px 2px 12px;
}
.realm svg { width: 15px; height: 15px; flex: none; }
.realm select { border: 0; background: transparent; padding: 5px 8px 5px 2px; max-width: 46vw; }

/* ----------------------------------------------------------------- forms */

select, input[type=search], button, textarea { font: inherit; color: var(--text); }

select {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  cursor: pointer;
}
select option { background: var(--panel-solid); color: var(--text); }

button {
  cursor: pointer;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  font-weight: 500;
  transition: border-color 0.2s, background 0.2s, transform 0.15s, box-shadow 0.2s;
}
button:hover { border-color: var(--border-strong); background: rgba(55, 46, 80, 0.85); }
button:active { transform: translateY(1px); }
button:disabled { opacity: 0.6; cursor: progress; }

button.primary {
  color: #2a1a00;
  font-weight: 700;
  border: 0;
  background: linear-gradient(180deg, #ffe08a 0%, var(--gold-2) 100%);
  box-shadow: var(--glow-gold);
  padding: 11px 22px;
}
button.primary:hover { background: linear-gradient(180deg, #fff0b8 0%, #ffc560 100%); transform: translateY(-1px); }

textarea {
  width: 100%;
  padding: 12px 14px;
  font: 0.82rem/1.5 var(--font-mono);
  background: rgba(8, 6, 14, 0.6);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  resize: vertical;
  word-break: break-all;
  transition: border-color 0.2s, box-shadow 0.2s;
}
textarea:focus { outline: none; border-color: var(--border-strong); box-shadow: 0 0 0 4px rgba(255, 211, 106, 0.08); }

code {
  font: 0.88em var(--font-mono);
  color: #ffe4a3;
  background: rgba(255, 211, 106, 0.08);
  border: 1px solid rgba(255, 211, 106, 0.14);
  padding: 1px 6px;
  border-radius: 6px;
}

kbd {
  font: 0.75rem var(--font-mono);
  color: var(--muted);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 1px 7px;
  background: rgba(255, 255, 255, 0.04);
}

/* ------------------------------------------------------------------ main */

main { width: 100%; max-width: 1120px; margin: 0 auto; padding: 28px 16px 64px; flex: 1; }

h1, h2, h3 { line-height: 1.2; }
h1 { margin: 0 0 8px; font-family: var(--font-display); font-weight: 700; font-size: 2.1rem; letter-spacing: 0.01em; }
h2 { margin: 0 0 14px; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); font-weight: 600; }
h2 em, .label em { font-style: normal; font-weight: 400; text-transform: none; letter-spacing: 0; opacity: 0.8; }

.lead { color: var(--muted); margin: 0 0 20px; font-size: 1.08rem; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}
.spark {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 12px 2px rgba(255, 211, 106, 0.7);
}

/* Entrance: sections rise in softly. */
#search-view > *, #item-view > *, #report-view > *, #privacy-view > * {
  animation: rise 0.6s cubic-bezier(.2, .7, .2, 1) both;
}
#search-view > *:nth-child(2), #item-view > *:nth-child(2), #report-view > *:nth-child(2) { animation-delay: 0.06s; }
#search-view > *:nth-child(3), #item-view > *:nth-child(3), #report-view > *:nth-child(3) { animation-delay: 0.12s; }
#search-view > *:nth-child(n+4), #item-view > *:nth-child(n+4) { animation-delay: 0.18s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------------ hero */

/* Above the sections after it: each section is its own layer (the entrance
   animation makes it one), so without this the search suggestions would
   drop behind "What it does". */
.hero { position: relative; z-index: 10; text-align: center; padding: 48px 0 24px; max-width: 760px; margin: 0 auto; }
.hero-title {
  font-size: clamp(2.2rem, 6vw, 3.9rem);
  font-weight: 800;
  line-height: 1.08;
  margin: 0 0 16px;
  text-shadow: 0 2px 30px rgba(255, 190, 80, 0.12);
}
.hero .gold-text { filter: drop-shadow(0 0 22px rgba(255, 190, 70, 0.35)); }
.hero .lead { max-width: 560px; margin: 0 auto 30px; }

.search-box { position: relative; text-align: left; }
.search-box::before {
  /* soft animated halo behind the box */
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 20px;
  background: linear-gradient(120deg, rgba(255, 211, 106, 0.55), rgba(155, 123, 255, 0.45), rgba(79, 209, 197, 0.35), rgba(255, 211, 106, 0.55));
  background-size: 300% 300%;
  animation: halo 8s linear infinite;
  filter: blur(14px);
  opacity: 0.35;
  transition: opacity 0.3s;
  z-index: 0;
}
.search-box:focus-within::before { opacity: 0.75; }
@keyframes halo { to { background-position: 300% 0; } }

input[type=search] {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 18px 56px 18px 54px;
  font-size: 1.15rem;
  background: rgba(16, 13, 26, 0.92);
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  box-shadow: var(--shadow);
  transition: border-color 0.2s;
}
input[type=search]::placeholder { color: var(--faint); }
input[type=search]:focus { outline: none; border-color: rgba(255, 211, 106, 0.6); }
input[type=search]::-webkit-search-cancel-button { filter: invert(0.7) sepia(1) hue-rotate(5deg); cursor: pointer; }
.search-icon {
  position: absolute; z-index: 2; left: 20px; top: 50%;
  width: 22px; height: 22px; margin-top: -11px;
  color: var(--gold); pointer-events: none;
}
.search-kbd { position: absolute; z-index: 2; right: 18px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.search-box:focus-within .search-kbd { opacity: 0; }

#search-status { min-height: 1.6em; margin: 10px 0 0; }

/* Autocomplete dropdown under the search box */
.results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 20;
  list-style: none;
  margin: 0;
  padding: 6px;
  background: rgba(20, 16, 32, 0.97);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.85);
  max-height: min(440px, 60vh);
  overflow-y: auto;
  animation: drop 0.16s ease-out;
}
@keyframes drop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.results li a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 10px;
  color: var(--text);
  transition: background 0.12s;
}
.results li.active a, .results li a:hover { background: rgba(255, 211, 106, 0.09); }
.results img { width: 34px; height: 34px; border-radius: 7px; flex: none; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6), 0 0 0 2px rgba(255, 255, 255, 0.08); }
.results .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.results .name mark { background: none; color: inherit; font-weight: 700; text-decoration: underline; text-decoration-color: rgba(255, 211, 106, 0.6); text-underline-offset: 3px; }
.results .price { white-space: nowrap; font-weight: 600; }
.results .unlisted { color: var(--faint); font-size: 0.85rem; font-weight: 400; }
.results .empty { padding: 12px; color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; margin: 6px 0 36px; }
.chips-label { color: var(--faint); font-size: 0.85rem; margin-right: 4px; }
.chip {
  padding: 6px 14px;
  font-size: 0.88rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  color: var(--muted);
}
.chip:hover { color: var(--gold); border-color: var(--border-strong); background: rgba(255, 211, 106, 0.07); }

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: 0 auto;
  max-width: 620px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--border);
  border: 1px solid var(--border);
}
.stats div { background: rgba(18, 15, 28, 0.85); padding: 16px 12px; }
.stats dt { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--faint); }
.stats dd { margin: 4px 0 0; font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------- landing sections */

.section-head { text-align: center; margin: 80px 0 28px; }
.section-title { font-family: var(--font-display); font-size: clamp(1.5rem, 3.5vw, 2.1rem); font-weight: 700; color: var(--text); text-transform: none; letter-spacing: 0.01em; margin: 0; }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 920px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .features { grid-template-columns: 1fr; } }
.feature {
  position: relative;
  padding: 24px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(.2, .7, .2, 1), border-color 0.3s, box-shadow 0.3s;
}
.feature::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(400px 160px at 0% 0%, rgba(255, 211, 106, 0.08), transparent 70%);
  pointer-events: none;
}
.feature:hover { transform: translateY(-4px); border-color: var(--border-strong); box-shadow: 0 24px 50px -24px rgba(255, 181, 71, 0.35); }
.feature h3 { margin: 14px 0 6px; font-size: 1.08rem; font-weight: 600; }
.feature p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.f-icon {
  display: inline-grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: 12px;
  color: var(--gold);
  background: linear-gradient(145deg, rgba(255, 211, 106, 0.16), rgba(155, 123, 255, 0.12));
  border: 1px solid rgba(255, 211, 106, 0.2);
}
.f-icon svg { width: 22px; height: 22px; }
.feature-link { display: inline-block; margin-top: 12px; font-weight: 600; font-size: 0.92rem; position: relative; z-index: 1; }
.feature-link span { display: inline-block; transition: transform 0.2s; }
.feature-link:hover span { transform: translateX(4px); }

.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; counter-reset: none; }
.steps li {
  position: relative;
  padding: 26px 24px 24px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(155, 123, 255, 0.07), rgba(25, 21, 38, 0.6));
  border: 1px solid var(--border);
}
.steps h3 { margin: 14px 0 6px; font-size: 1.05rem; font-weight: 600; }
.steps p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.step-num {
  display: inline-grid;
  place-items: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  font-family: var(--font-display);
  font-weight: 800;
  color: #2a1a00;
  background: radial-gradient(circle at 35% 30%, #fff6c2, var(--gold) 50%, var(--gold-deep));
  box-shadow: 0 0 18px rgba(255, 190, 70, 0.4);
}
.pill {
  display: inline-block;
  margin-top: 14px;
  padding: 4px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 999px;
  color: var(--violet);
  background: rgba(155, 123, 255, 0.1);
  border: 1px solid rgba(155, 123, 255, 0.3);
}

/* ----------------------------------------------------------------- cards */

.card {
  background: var(--panel);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.card-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.card-row .card { margin-bottom: 16px; }

.page-head { margin: 12px 0 24px; }

.paste { padding: 16px; }
.paste-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 14px 0 0; }

/* ------------------------------------------------------------- item page */

.back { display: inline-flex; gap: 6px; margin-bottom: 18px; color: var(--muted); font-size: 0.92rem; }
.back:hover { color: var(--gold); }

.item-hero {
  position: relative;
  padding: 24px;
  margin-bottom: 18px;
  border-radius: 20px;
  background:
    radial-gradient(500px 200px at 0% 0%, color-mix(in srgb, var(--q, #ffd36a) 18%, transparent), transparent 70%),
    var(--panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.item-head { display: flex; align-items: center; gap: 18px; }
.item-frame {
  flex: none;
  padding: 3px;
  border-radius: 14px;
  background: linear-gradient(145deg, var(--q, #ffd36a), rgba(0, 0, 0, 0.6));
  box-shadow: 0 0 28px -4px var(--q, #ffd36a);
}
.item-frame img { display: block; width: 64px; height: 64px; border-radius: 11px; background: var(--panel-solid); }
.item-title { min-width: 0; }
.item-head h1 { margin: 0; font-size: clamp(1.5rem, 4vw, 2.2rem); overflow-wrap: anywhere; }
#variant { margin-top: 8px; max-width: 100%; }

.state {
  margin: 18px 0 0;
  padding: 12px 16px;
  font-size: 1.12rem;
  border-radius: 12px;
  background: rgba(255, 211, 106, 0.06);
  border-left: 3px solid var(--gold);
}
.state:empty { display: none; }

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.tile {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
}
.tile:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.tile .label { color: var(--muted); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600; }
.tile .value { font-size: 1.4rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.tile-main {
  background: linear-gradient(160deg, rgba(255, 211, 106, 0.16), rgba(25, 21, 38, 0.75) 60%);
  border-color: rgba(255, 211, 106, 0.3);
}
.tile-main::after {
  content: "";
  position: absolute;
  right: -30px; top: -30px;
  width: 90px; height: 90px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 211, 106, 0.25), transparent 70%);
}

.sentences { list-style: none; padding: 0; margin: 0 0 26px; display: grid; gap: 8px; }
.sentences li {
  position: relative;
  padding: 10px 14px 10px 40px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border);
}
.sentences li::before {
  content: "";
  position: absolute;
  left: 15px; top: 50%;
  width: 10px; height: 10px;
  margin-top: -5px;
  transform: rotate(45deg);
  border-radius: 2px;
  background: linear-gradient(135deg, var(--gold), var(--violet));
  box-shadow: 0 0 10px rgba(255, 211, 106, 0.5);
}
.sentences li:empty { display: none; }

.ranges {
  display: inline-flex;
  gap: 2px;
  padding: 4px;
  margin-bottom: 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  flex-wrap: wrap;
}
.ranges button { padding: 6px 16px; border: 0; background: transparent; color: var(--muted); border-radius: 9px; font-size: 0.9rem; }
.ranges button:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.ranges button.active { color: #2a1a00; font-weight: 700; background: linear-gradient(180deg, #ffe08a, var(--gold-2)); box-shadow: 0 4px 16px -4px rgba(255, 181, 71, 0.6); }

.chart-box { position: relative; height: 200px; }
.chart-box.tall { height: 300px; }

.heatmap-wrap { overflow-x: auto; padding-bottom: 4px; }
.heatmap { border-collapse: separate; border-spacing: 3px; font-size: 0.72rem; }
.heatmap th { color: var(--faint); font-weight: 500; padding: 0 6px 0 0; text-align: right; }
.heatmap thead th { text-align: center; padding: 0 0 2px; }
.heatmap td {
  width: 24px; min-width: 24px; height: 22px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.04);
  transition: transform 0.12s, box-shadow 0.12s;
}
.heatmap td:hover { transform: scale(1.25); box-shadow: 0 0 0 1px var(--gold), 0 0 14px rgba(255, 211, 106, 0.5); position: relative; z-index: 1; }

/* ---------------------------------------------------------------- tables */

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
table.data th {
  text-align: left;
  color: var(--faint);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-strong);
}
table.data td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr, table.data tr { transition: background 0.12s; }
table.data tr:hover td { background: rgba(255, 211, 106, 0.04); }
table.data .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.data th.num { text-align: right; }
table.data img { width: 26px; height: 26px; border-radius: 6px; vertical-align: middle; margin-right: 10px; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6); }
table.data .where { color: var(--muted); font-size: 0.85rem; }

.prose h2 { margin-top: 26px; color: var(--gold); }
.prose h2:first-child { margin-top: 0; }
.prose p { line-height: 1.7; margin: 8px 0; color: #ddd6e8; }

/* ----------------------------------------------------- money and quality */

/* Crafting quality badge: tier 1 bronze, tier 2 silver, tier 3 gold */
.rank {
  display: inline-block;
  font: 700 0.7rem/1 var(--font-body);
  letter-spacing: 0.02em;
  padding: 4px 8px;
  border-radius: 999px;
  color: #1a1612;
  vertical-align: middle;
  white-space: nowrap;
}
.rank-1 { background: linear-gradient(180deg, #e3a874, #b5733f); }
.rank-2 { background: linear-gradient(180deg, #eef1f4, #a9afb6); }
.rank-3 { background: linear-gradient(180deg, #ffe58a, #e0a92a); box-shadow: 0 0 12px rgba(255, 211, 106, 0.4); }
h1 .rank { font-size: 0.75rem; }

/* Gold, silver and copper coins, drawn like the in-game money icons */
.money { white-space: nowrap; font-variant-numeric: tabular-nums; }
.coin {
  display: inline-block;
  width: 0.8em;
  height: 0.8em;
  margin: 0 0.3em 0 0.14em;
  border-radius: 50%;
  vertical-align: -0.06em;
}
.money .coin:last-child { margin-right: 0; }
.coin-g { background: radial-gradient(circle at 35% 30%, #fff6b0, #ffd100 45%, #a87400); box-shadow: inset 0 0 0 1px #7a5400, 0 0 6px rgba(255, 209, 0, 0.35); }
.coin-s { background: radial-gradient(circle at 35% 30%, #ffffff, #c9cdd2 45%, #74797f); box-shadow: inset 0 0 0 1px #55595e; }
.coin-c { background: radial-gradient(circle at 35% 30%, #ffd0a8, #c47a3f 45%, #7a4220); box-shadow: inset 0 0 0 1px #5c3015; }

.q-POOR { color: #9d9d9d; }
.q-COMMON { color: #ffffff; }
.q-UNCOMMON { color: #1eff00; }
.q-RARE { color: #3d9bff; }
.q-EPIC { color: #b65cff; }
.q-LEGENDARY { color: #ff8000; }
.q-ARTIFACT { color: #e6cc80; }
.q-HEIRLOOM { color: #00ccff; }

/* Glow colour of the item page header (set from the item's quality). */
[data-q="POOR"] { --q: #9d9d9d; }
[data-q="COMMON"] { --q: #d8d2c4; }
[data-q="UNCOMMON"] { --q: #1eff00; }
[data-q="RARE"] { --q: #0070dd; }
[data-q="EPIC"] { --q: #a335ee; }
[data-q="LEGENDARY"] { --q: #ff8000; }
[data-q="ARTIFACT"] { --q: #e6cc80; }
[data-q="HEIRLOOM"] { --q: #00ccff; }

/* ---------------------------------------------------------------- footer */

footer {
  border-top: 1px solid var(--border);
  background: rgba(8, 6, 14, 0.6);
  color: var(--muted);
  font-size: 0.88rem;
  padding: 36px 16px 24px;
}
.footer-inner {
  max-width: 1088px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.footer-brand { max-width: 460px; }
.footer-brand p { margin: 8px 0 0; }
.footer-links { display: flex; gap: 22px; flex-wrap: wrap; align-items: flex-start; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--gold); }
.fine { max-width: 1088px; margin: 24px auto 0; color: var(--faint); font-size: 0.8rem; }

/* ---------------------------------------------------------------- mobile */

@media (max-width: 720px) {
  .top-inner { gap: 10px; }
  .nav { order: 3; width: 100%; margin: 0; justify-content: center; }
  .top-right { margin-left: auto; }
  .live #live-text { display: none; }
  .live { padding: 7px; }
  .hero { padding-top: 28px; }
  .search-kbd { display: none; }
  input[type=search] { padding-right: 18px; }
  .section-head { margin-top: 56px; }
  .card-row { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  h1 { font-size: 1.6rem; }
  .brand-text { font-size: 1.05rem; }
  .crest { width: 30px; height: 30px; }
  .top-inner { flex-wrap: wrap; }
  .top-right { gap: 8px; }
  .realm select { max-width: 110px; text-overflow: ellipsis; }
  .stats dd { font-size: 1.2rem; }
  .tile .value { font-size: 1.15rem; }
  .item-hero { padding: 18px; }
  .item-frame img { width: 52px; height: 52px; }
  .card { padding: 16px; }
}

@media (max-width: 400px) {
  .live { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
