:root {
  color-scheme: dark;
  font-family: Arial, Helvetica, sans-serif;
  color: #e2e4e8;
  background: #0d1016;
  font-synthesis: none;
  --muted: #a6acb8;
  --gold: #d1b779;
  --line: #30333c;
}

* { box-sizing: border-box; }

body { margin: 0; }

button, input { font: inherit; }

button, .install-link {
  min-height: 42px;
  padding: 9px 18px;
  border: 1px solid #82714e;
  border-radius: 3px;
  color: #f0ddb1;
  background: #2a2821;
  cursor: pointer;
}

button:hover, .install-link:hover { background: #373127; border-color: #b09a67; }
button:active, .install-link:active { background: #201f1b; }
button:disabled { opacity: .6; cursor: wait; }

button:focus-visible, .install-link:focus-visible, input:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

[hidden] { display: none !important; }

.market {
  width: min(1080px, 100%);
  margin: 0 auto;
  padding: 54px 28px 64px;
}

.site-header {
  border-bottom: 1px solid #706344;
  padding-bottom: 28px;
}

.header-title { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 18px; }
.install-link { display: inline-block; flex-shrink: 0; text-decoration: none; font-size: 14px; line-height: 22px; }

h1 {
  margin: 0;
  color: #f0dfba;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(29px, 5vw, 38px);
  font-weight: 400;
  letter-spacing: .025em;
  line-height: 1.2;
}

h1 span { color: var(--gold); }

.site-header p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.site-header .install-help { max-width: 760px; }
.install-help a { color: var(--gold); text-underline-offset: 3px; }
.install-help a:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

.search-form { margin: 28px 0 38px; }

.search-form label {
  display: block;
  margin-bottom: 9px;
  color: #c8cbd2;
  font-size: 13px;
}

.search-controls { display: flex; gap: 10px; max-width: 650px; }

.search-controls input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 10px 13px;
  border: 1px solid #454955;
  border-radius: 3px;
  color: #e2e4e8;
  background: #151923;
  font-size: 14px;
}

.search-controls input::placeholder { color: #858b98; opacity: 1; }

.section-heading {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-bottom: 16px;
}

h2 { margin: 0; font-size: 17px; font-weight: 500; color: #e1d4b9; }

.status { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.status[data-error="true"] { color: #e7b4a1; }

.column-labels, .listing {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, .38fr) minmax(170px, .5fr);
  gap: 28px;
}

.column-labels { padding: 0 20px 10px; color: var(--muted); font-size: 12px; }
.listings { border-top: 1px solid var(--line); }

.listing {
  padding: 22px 20px;
  border: 1px solid var(--line);
  border-top: 0;
  background: #141821;
}

.listing:nth-child(even) { background: #12161e; }
.listing > div { min-width: 0; }
.item-name, .asking-price, .character, .server, .item-type, .item-details li { overflow-wrap: anywhere; }
.item-name { margin: 0; color: #e4d29b; font-size: 16px; font-weight: 500; line-height: 1.5; }
.item-type { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.item-details { list-style: none; padding: 0; margin: 12px 0 0; color: #c1c7d2; font-size: 13px; line-height: 1.7; }
.asking-price { margin: 0; font-size: 14px; line-height: 1.7; white-space: pre-wrap; }
.character { margin: 0; color: #e2e4e8; font-size: 14px; line-height: 1.7; user-select: text; }
.server { margin: 3px 0 12px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.copy-button { min-height: 36px; padding: 7px 10px; font-size: 12px; text-align: left; }
.copy-status { margin: 9px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.mobile-label { display: none; }
.empty-state { margin: 0; padding: 46px 20px; border: 1px solid var(--line); border-top: 0; color: var(--muted); text-align: center; font-size: 14px; line-height: 1.6; }
.pagination { display: flex; justify-content: center; margin-top: 22px; }

@media (max-width: 650px) {
  .market { padding: 30px 16px 40px; }
  .site-header { padding-bottom: 22px; }
  .search-form { margin: 24px 0 30px; }
  .column-labels { display: none; }
  .listing { grid-template-columns: 1fr; gap: 19px; padding: 21px 17px; }
  .mobile-label { display: block; margin: 0 0 5px; color: var(--muted); font-size: 12px; }
  .server { margin-bottom: 10px; }
  .copy-button { min-height: 42px; padding: 9px 12px; }
}

@media (prefers-reduced-motion: no-preference) {
  button { transition: background-color .12s, border-color .12s; }
}
