/* Maple Price Index
   Henesys sky page, one navy item-tooltip panel, one megaphone band. */

:root {
  --sky: #d5e3f0;
  --sky-deep: #bdd1e5;
  --paper: #f7fafd;
  --ink: #172235;
  --ink-soft: #4a5a73;
  --rule: #c6d4e3;
  --row-hover: #e8f0f8;
  --row-active: #dbe7f4;

  --tip: #1f2c47;
  --tip-2: #283a5c;
  --tip-edge: #9db1d3;
  --tip-ink: #eef3fb;
  --tip-soft: #b0bfd9;
  --tip-rule: #3b4e74;

  --mega: #c93a86;
  --mega-edge: #f0a9cf;
  --ask: #b02e74;
  --bid: #11796a;
  --ask-on-tip: #ff9fd0;
  --bid-on-tip: #6fe0c8;
  --meso: #e3b23c;
  --focus: #1c6fd1;
  --check: #8a5a00;
  --flag: #b3261e;
  --check-on-tip: #ffd27a;
  --flag-on-tip: #ff8a80;

  --font: Verdana, "DejaVu Sans", "Bitstream Vera Sans", Tahoma, sans-serif;
  --step-0: 0.8125rem;   /* 13px: table, body */
  --step-1: 0.9375rem;   /* 15px */
  --step-2: 1.25rem;     /* 20px */
  --step-3: 1.75rem;     /* 28px */
  --radius: 4px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --sky: #0f1a2c;
    --sky-deep: #16243b;
    --paper: #142036;
    --ink: #dbe5f2;
    --ink-soft: #9fb0c9;
    --rule: #26385a;
    --row-hover: #1a2a45;
    --row-active: #213456;
    --tip: #1c2943;
    --tip-2: #24365a;
    --tip-edge: #6f86b2;
    --ask: #f08cc1;
    --bid: #5fd3bb;
    --focus: #7ab4ff;
    --check: #f0c35a;
    --flag: #ff8a80;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--sky);
  color: var(--ink);
  font: var(--step-0)/1.55 var(--font);
  font-variant-numeric: tabular-nums;
}

a { color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip { position: absolute; left: -999px; top: 0; background: var(--paper); padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; }

/* ---------------------------------------------------------------- shout band */

.shout {
  display: flex;
  align-items: center;
  gap: .75rem;
  min-height: 2.5rem;
  padding: .45rem 1.25rem;
  background: var(--mega);
  border-bottom: 2px solid var(--mega-edge);
  color: #fff;
  overflow: hidden;
}
.shout-icon { flex: none; }
.shout-line {
  margin: 0;
  font-size: var(--step-0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 0 rgba(80, 0, 40, .35);
}
.shout-line.enter { animation: shout-in .5s ease-out both; }
.shout-line .who { font-weight: bold; }
.shout-line .price { font-weight: bold; color: #fff6c9; }
@keyframes shout-in {
  from { transform: translateY(70%); opacity: 0; }
  to   { transform: none; opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .shout-line.enter { animation: none; }
}

/* ---------------------------------------------------------------- header */

.top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 1rem 2rem;
  align-items: end;
  padding: 1.5rem 1.25rem 1rem;
  max-width: 1320px;
  margin: 0 auto;
}
.brand h1 {
  margin: 0;
  font-size: var(--step-3);
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.tagline { margin: .35rem 0 0; color: var(--ink-soft); max-width: 46ch; }
.status { margin: .35rem 0 0; color: var(--ink-soft); min-height: 1.55em; }

.controls { display: grid; gap: .6rem; }
.search input {
  width: 100%;
  font: inherit;
  font-size: var(--step-1);
  padding: .6rem .8rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}
.search input::placeholder { color: var(--ink-soft); }
.selects { display: flex; flex-wrap: wrap; gap: .5rem 1rem; color: var(--ink-soft); }
.selects label { display: inline-flex; align-items: center; gap: .4rem; }
.selects select {
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: .25rem .4rem;
}

/* ---------------------------------------------------------------- layout */

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 400px);
  gap: 1.25rem;
  align-items: start;
  padding: 0 1.25rem 2rem;
  max-width: 1320px;
  margin: 0 auto;
}

/* ---------------------------------------------------------------- price table */

.prices {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow-x: auto;
}
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left;
  font-weight: normal;
  color: var(--ink-soft);
  padding: .65rem .75rem;
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
  background: var(--sky-deep);
}
.table td {
  padding: .55rem .75rem;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}
.table tbody tr { cursor: pointer; }
.table tbody tr:hover { background: var(--row-hover); }
.table tbody tr.active { background: var(--row-active); }
.table tbody tr:last-child td { border-bottom: 0; }
.num { text-align: right; white-space: nowrap; }
.table th.num { text-align: right; }

.item-link { font-weight: bold; text-decoration: none; }
.item-link:hover { text-decoration: underline; }
.sub { display: block; color: var(--ink-soft); font-size: .75rem; margin-top: .1rem; }
.flag { color: var(--ink-soft); font-style: italic; }
.price-main { font-weight: bold; font-size: var(--step-1); }
.ask { color: var(--ask); }
.bid { color: var(--bid); }
.muted { color: var(--ink-soft); }
.conf-low { opacity: .7; }

.agree-chip { display: block; font-size: .75rem; margin-top: .1rem; }
.agree-chip.agree, .agree-chip.few { color: var(--ink-soft); }
.agree-chip.check { color: var(--check); font-weight: bold; }
.agree-chip.disagree { color: var(--flag); font-weight: bold; }
.ref-col { white-space: nowrap; }

.flagged {
  font: inherit;
  color: var(--flag);
  background: none;
  border: 0;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.empty { margin: 0; padding: 2rem 1.25rem; color: var(--ink-soft); max-width: 60ch; }

/* ---------------------------------------------------------------- tooltip panel
   Modelled on an in-game item tooltip: navy, thin light inner edge. */

.tip {
  position: sticky;
  top: 1rem;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  background: linear-gradient(180deg, var(--tip-2), var(--tip) 6rem);
  color: var(--tip-ink);
  border: 1px solid #0d1528;
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px var(--tip-edge), 0 6px 18px rgba(15, 30, 60, .25);
  padding: 1.1rem 1.15rem 1.25rem;
}
.tip:focus { outline: none; }
.tip h2 {
  margin: 0;
  font-size: var(--step-2);
  line-height: 1.25;
  text-align: center;
}
.tip h3 {
  margin: 1.25rem 0 .5rem;
  font-size: var(--step-0);
  font-weight: bold;
  color: var(--tip-soft);
  border-bottom: 1px solid var(--tip-rule);
  padding-bottom: .3rem;
}
.tip p { margin: .4rem 0; }
.tip .center { text-align: center; }
.tip .soft { color: var(--tip-soft); }
.tip .ask { color: var(--ask-on-tip); }
.tip .bid { color: var(--bid-on-tip); }
.tip a { color: #cfe1ff; }
.tip-close {
  float: right;
  font: inherit;
  color: var(--tip-soft);
  background: none;
  border: 0;
  padding: 0 .2rem;
  cursor: pointer;
}
.tip-close:hover { color: var(--tip-ink); }

.estimate {
  text-align: center;
  margin: 1rem 0 .25rem;
}
.estimate .value {
  display: block;
  font-size: 2.25rem;
  font-weight: bold;
  line-height: 1.1;
  color: #fff;
}
.estimate .coin {
  display: inline-block;
  width: .6em; height: .6em;
  margin-right: .25em;
  vertical-align: .08em;
  border-radius: 50%;
  background: var(--meso);
  box-shadow: inset 0 0 0 .1em #946a0d;
}

.vtable { width: 100%; border-collapse: collapse; }
.vtable th, .vtable td { padding: .3rem .25rem; text-align: left; border-bottom: 1px solid var(--tip-rule); }
.vtable th { font-weight: normal; color: var(--tip-soft); }
.vtable .num { text-align: right; }
.vtable .ref-row td { color: var(--tip-soft); font-style: italic; }
.vtable .range { display: block; font-size: .7rem; color: var(--tip-soft); }

.chart { width: 100%; height: auto; display: block; margin-top: .25rem; }
.chart .grid { stroke: var(--tip-rule); stroke-width: 1; }
.chart .axis { fill: var(--tip-soft); font-size: 10px; font-family: var(--font); }
.chart .line-ask { stroke: var(--ask-on-tip); fill: none; stroke-width: 2; }
.chart .line-bid { stroke: var(--bid-on-tip); fill: none; stroke-width: 2; }
.chart .dot-ask { fill: var(--ask-on-tip); }
.chart .dot-bid { fill: var(--bid-on-tip); }
.legend { display: flex; gap: 1rem; color: var(--tip-soft); font-size: .75rem; }
.legend .key { display: inline-block; width: .9em; height: 3px; vertical-align: middle; margin-right: .35em; }
.legend .key.ask { background: var(--ask-on-tip); }
.legend .key.bid { background: var(--bid-on-tip); }

.offers { list-style: none; margin: 0; padding: 0; }
.offers li { padding: .45rem 0; border-bottom: 1px solid var(--tip-rule); }
.offers li:last-child { border-bottom: 0; }
.offers .line1 { display: flex; justify-content: space-between; gap: .5rem; }
.offers .msg { display: block; color: var(--tip-soft); font-size: .75rem; overflow-wrap: anywhere; }
.offers .side { font-weight: bold; }
.offers button.item-btn {
  font: inherit; font-weight: bold; color: var(--tip-ink);
  background: none; border: 0; padding: 0; cursor: pointer; text-align: left;
}
.offers button.item-btn:hover { text-decoration: underline; }

.sources { list-style: none; margin: 0; padding: 0; }
.sources li { padding: .35rem 0; }
.sources .attr { display: block; font-size: .7rem; color: var(--tip-soft); }

.opinion {
  margin: .9rem 0 0;
  padding: .6rem .75rem;
  border-left: 3px solid var(--tip-soft);
  background: rgba(255, 255, 255, .04);
}
.opinion.check { border-left-color: var(--check-on-tip); }
.opinion.disagree { border-left-color: var(--flag-on-tip); }
.opinion .verdict { font-weight: bold; margin: 0 0 .3rem; }
.opinion.check .verdict { color: var(--check-on-tip); }
.opinion.disagree .verdict { color: var(--flag-on-tip); }
.opinion ul { margin: .4rem 0 0; padding-left: 1.1rem; color: var(--tip-soft); font-size: .75rem; }
.opinion li { margin: .2rem 0; }
.chart .line-ref { stroke: var(--tip-ink); fill: none; stroke-width: 1.5; stroke-dasharray: 4 3; opacity: .8; }
.legend .key.ref { background: var(--tip-ink); opacity: .8; }

.badge {
  display: inline-block;
  padding: 0 .4rem;
  border-radius: 3px;
  font-size: .7rem;
  border: 1px solid currentColor;
}

/* ---------------------------------------------------------------- flips */

.flips-link { color: var(--bid); font-weight: bold; text-underline-offset: 2px; }

.flips {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 1.25rem 1.5rem;
}
.flips-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem 1rem; }
.flips-head h2 { margin: 0; font-size: var(--step-2); }
.flips-head label { display: inline-flex; align-items: center; gap: .4rem; color: var(--ink-soft); }
.flips-head select {
  font: inherit; color: var(--ink); background: var(--paper);
  border: 1px solid var(--rule); border-radius: var(--radius); padding: .25rem .4rem;
}
.flips-intro { margin: .4rem 0 .8rem; color: var(--ink-soft); max-width: 90ch; }
.flips-wrap {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow-x: auto;
}
.flip-table .line { display: block; color: var(--ink-soft); font-size: .75rem; overflow-wrap: anywhere; max-width: 60ch; }
.flip-table .gain { font-weight: bold; color: var(--bid); font-size: var(--step-1); }
.chips { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .25rem; }
.chip { font-size: .7rem; padding: 0 .4rem; border-radius: 3px; border: 1px solid currentColor; white-space: nowrap; }
.chip.buyer { color: var(--bid); }
.chip.check { color: var(--check); }
.chip.gear { color: var(--ink-soft); }

/* ---------------------------------------------------------------- help collect */

.contribute {
  max-width: 1320px;
  margin: 1.5rem auto 0;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--rule);
  font-size: .85rem;
}
.contribute h2 { font-size: 1rem; margin: 0 0 .4rem; }
.contribute p, .contribute ol { max-width: 80ch; margin: .4rem 0; }
.contribute li { margin: .3rem 0; }
.contribute a:not([href]) { color: var(--ink-soft); }

/* ---------------------------------------------------------------- footer */

.foot {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 1.25rem 2.5rem;
  color: var(--ink-soft);
  font-size: .75rem;
}
.foot p { max-width: 80ch; margin: .4rem 0; }

/* ---------------------------------------------------------------- small screens */

@media (max-width: 900px) {
  .top { grid-template-columns: 1fr; padding-top: 1.1rem; }
  .layout { grid-template-columns: 1fr; }
  .tip { position: static; max-height: none; }
  .table .when { display: none; }
}
@media (max-width: 560px) {
  .shout { padding: .4rem .8rem; }
  .top, .layout, .foot { padding-left: .75rem; padding-right: .75rem; }
  .table th, .table td { padding: .5rem .45rem; }
  .table th:nth-child(6), .table td:nth-child(6) { display: none; }
  .table th:nth-child(3), .table td:nth-child(3), .table th:nth-child(4), .table td:nth-child(4) { display: none; }
  .flips { padding-left: .75rem; padding-right: .75rem; }
  .flip-table th:nth-child(3), .flip-table td:nth-child(3), .flip-table th:nth-child(4), .flip-table td:nth-child(4) { display: table-cell; }
  .flip-table th:nth-child(6), .flip-table td:nth-child(6) { display: none; }
  .brand h1 { font-size: 1.5rem; }
}
