/* aboveyou.lol — dark neutral chrome, one accent lifted from the render (#EDAF0B). */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* One focus treatment, everywhere. Keyboard only — pointer users never see it. */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 4px;
}
.badge-card:focus-visible { outline-offset: 1px; }
.row:focus-visible { outline-offset: -2px; }

:root {
  --bg:      #0B0B0C;
  --panel:   #101011;
  --panel-2: #17171A;
  --panel-3: #1E1E21;
  --line:    #232326;
  --line-2:  #34343A;
  --text:    #EDEDEA;
  --text-2:  #9A9A93;
  --text-3:  #66665F;
  --gold:    #EDAF0B;
  --gold-2:  #A97C08;
  --red:     #D6382A;
  --green:   #5B9E4F;

  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  --bar-h: 52px;
  --rail-w: 296px;
}

html, body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

h1, h2, h3 { margin: 0; font-weight: 600; }
h1 { font-size: 15px; letter-spacing: -0.01em; }
h2 { font-size: 14px; }
p  { margin: 0; }
button { font: inherit; color: inherit; }

/* ---------- top bar ---------- */

.bar {
  height: var(--bar-h);
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 14px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 40;
}

.mark {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
}
.mark::after {
  content: "";
  display: inline-block;
  width: 5px; height: 5px;
  margin-left: 7px;
  vertical-align: 2px;
  background: var(--gold);
  border-radius: 1px;
}

.bar-stats {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-2);
  font-size: 13px;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}
.stat b { color: var(--text); font-weight: 500; font-variant-numeric: tabular-nums; }
.stat-sep { width: 1px; height: 14px; background: var(--line-2); }

.bar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

/* ---------- buttons ---------- */

.btn {
  height: 30px;
  padding: 0 12px;
  border-radius: 6px;
  border: 1px solid var(--line-2);
  background: var(--panel-2);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
  white-space: nowrap;
}
.btn:hover { background: var(--panel-3); border-color: #43434A; }
.btn:active { background: #101012; }
.btn:disabled { opacity: .45; cursor: default; }
.btn:disabled:hover { background: var(--panel-2); border-color: var(--line-2); }

.btn-primary {
  background: var(--gold);
  border-color: var(--gold);
  color: #17140A;
  font-weight: 600;
}
.btn-primary:hover { background: #FFC01B; border-color: #FFC01B; }
.btn-primary:active { background: var(--gold-2); border-color: var(--gold-2); }

.btn-quiet { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-quiet:hover { background: var(--panel-2); border-color: var(--line); color: var(--text); }

.btn-danger { background: transparent; border-color: var(--line-2); color: var(--red); }
.btn-danger:hover { background: #1B1214; border-color: #4A2320; }

.btn-sm { height: 26px; padding: 0 9px; font-size: 12px; }
.btn-block { width: 100%; }

/* ---------- stage ---------- */

.stage {
  position: absolute;
  inset: var(--bar-h) 0 0 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  background: #08080A;
}

.city {
  position: relative;
  grid-column: 1;
  grid-row: 1;
  width: min(100%, 150vh);
  height: auto;
  aspect-ratio: 1916 / 821;
  align-self: start;
  justify-self: center;
  overflow: hidden;
  background: #08080A;
  transition: background 420ms ease;
  cursor: grab;
  touch-action: none;
  contain: layout paint;
  min-width: 0;
}
.city.is-dragging { cursor: grabbing; }

.world {
  position: absolute;
  top: 0; left: 0;
  width: 1916px;
  height: 821px;
  transform-origin: 0 0;
  will-change: transform;
  z-index: 1;
  background-image: var(--lqip-day);
  background-size: 100% 100%;
}
.world.is-night { background-image: var(--lqip-night); }

.plate {
  position: absolute;
  top: 0; left: 0;
  width: 1916px; height: 821px;
  user-select: none;
  -webkit-user-drag: none;
  transition: opacity 420ms ease;
}
.plate-night { opacity: 0; }
.world.is-night .plate-night { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .plate { transition: none; } }
.motion {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}
.badges {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

/* ---------- badges ---------- */

.badge {
  position: absolute;
  width: 0;
  height: 0;
  pointer-events: none;
}
.badge-card {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 7px;
  height: 26px;
  padding: 0 8px 0 5px;
  background: rgba(11,11,12,.94);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 5px;
  pointer-events: auto;
  cursor: pointer;
  white-space: nowrap;
  color: inherit;
  text-decoration: none;
  transform: translate(calc(-50% + var(--label-x, 0px)), calc(-100% + var(--label-y, -16px)));
  transform-origin: 50% 100%;
  transition: border-color 120ms ease, background 120ms ease;
}
.badge-card:hover { border-color: var(--gold); background: #0B0B0C; }
.badge.is-selected .badge-card { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }

.badge-n {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--gold);
  background: rgba(237,175,11,.12);
  border-radius: 3px;
  padding: 2px 4px;
  letter-spacing: 0;
}
.badge-logo {
  width: 16px; height: 16px;
  border-radius: 3px;
  object-fit: cover;
  display: block;
  background: var(--panel-3);
}
.badge-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.badge-stem {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  width: 1px;
  height: 1px;
  background: rgba(255,255,255,.42);
  transform-origin: 0 50%;
}
.badge-stem::after {
  content: "";
  position: absolute;
  left: -1px;
  top: -1px;
  width: 3px; height: 3px;
  background: #fff;
  border-radius: 50%;
}

/* vacant */
.badge.is-open .badge-card { background: rgba(11,11,12,.82); border-style: dashed; border-color: rgba(237,175,11,.55); }
.badge.is-open .badge-price { font-family: var(--mono); font-size: 11px; color: var(--gold); }
.badge.is-open .badge-stem { background: rgba(237,175,11,.5); }
.badge.is-open .badge-stem::after { background: var(--gold); }

/* Compact the complete label set at the overview instead of hiding listings. */
.badges.is-tight .badge-card { height: 22px; gap: 4px; padding: 0 5px 0 4px; border-radius: 4px; }
.badges.is-tight .badge-n { font-size: 8px; padding: 1px 3px; }
.badges.is-tight .badge-logo { width: 13px; height: 13px; }
.badges.is-tight .badge-name { display: block; max-width: 130px; font-size: 10px; }
.badges.is-tight .badge-price { font-size: 9px; }

@media (max-width: 560px) {
  .badges.is-tight .badge-card { height: 16px; gap: 2px; padding: 0 2px; border-radius: 3px; }
  .badges.is-tight .badge:not(.is-open) .badge-n { display: none; }
  .badges.is-tight .badge-n { font-size: 6px; padding: 0 1px; }
  .badges.is-tight .badge-logo { width: 9px; height: 9px; border-radius: 2px; }
  .badges.is-tight .badge-name { display: block; max-width: 58px; font-size: 8px; }
  .badges.is-tight .badge-price { font-size: 7px; }
}
.badge[hidden] { display: none; }

/* eviction */
@keyframes shake {
  0%,100% { transform: translate(calc(-50% + var(--label-x,0px)), calc(-100% + var(--label-y,-16px))) rotate(0); }
  15% { transform: translate(calc(-50% + var(--label-x,0px) - 3px), calc(-100% + var(--label-y,-16px))) rotate(-2deg); }
  35% { transform: translate(calc(-50% + var(--label-x,0px) + 3px), calc(-100% + var(--label-y,-16px))) rotate(2deg); }
  55% { transform: translate(calc(-50% + var(--label-x,0px) - 2px), calc(-100% + var(--label-y,-16px))) rotate(-1deg); }
  75% { transform: translate(calc(-50% + var(--label-x,0px) + 2px), calc(-100% + var(--label-y,-16px))) rotate(1deg); }
}
.badge.is-outbid .badge-card { animation: shake 520ms ease-in-out 2; }
.badge.is-outbid .badge-card { border-color: var(--red); }
.badge-stamp {
  position: absolute;
  top: -9px; left: 50%;
  transform: translateX(-50%) rotate(-7deg);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: var(--red);
  border-radius: 2px;
  padding: 1px 5px;
}
.badge.is-arriving .badge-card { animation: arrive 700ms ease-out; }
@keyframes arrive { from { opacity: 0; } to { opacity: 1; } }

/* ---------- city overlays ---------- */

.zoomer {
  position: absolute;
  right: 12px; bottom: 12px;
  display: flex;
  gap: 4px;
  z-index: 10;
}
.zbtn {
  width: 28px; height: 28px;
  border: 1px solid var(--line-2);
  background: rgba(16,16,17,.9);
  color: var(--text-2);
  border-radius: 5px;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  transition: color 120ms ease, border-color 120ms ease;
}
.zbtn:hover { color: var(--text); border-color: #4A4A52; }
.zbtn:disabled { opacity: .35; cursor: default; border-color: var(--line-2); }
.zbtn-wide { width: auto; padding: 0 9px; font-size: 12px; }

.readout {
  position: absolute;
  left: 12px; bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 30px;
  padding: 0 11px;
  background: rgba(16,16,17,.94);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 12px;
  color: var(--text-2);
  z-index: 10;
  max-width: calc(100% - 130px);
}
.ro-n { font-family: var(--mono); font-size: 11px; color: var(--gold); }
.ro-name { color: var(--text); font-weight: 500; }
.ro-sep { width: 1px; height: 12px; background: var(--line-2); }
.ro-bid { font-family: var(--mono); color: var(--text); }
.ro-held { color: var(--text-3); }

.rail-foot {
  display: block;
  width: 100%;
  text-align: left;
  padding: 11px 14px;
  border: 0;
  border-top: 1px solid var(--line);
  background: var(--panel);
  cursor: pointer;
  transition: background 120ms ease;
}
.rail-foot:hover { background: var(--panel-2); }
.rail-foot-main { display: block; font-size: 13px; color: var(--text); }
.rail-foot-sub { display: block; font-size: 11px; color: var(--text-3); }

/* the readout keeps its own row above the zoom controls on small screens */
.readout { transition: opacity 120ms ease; }

/* ---------- rail ---------- */

.rail {
  grid-column: 1;
  grid-row: 2;
  background: var(--panel);
  border-top: 1px solid var(--line-2);
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
}
.rail-list, .rail-detail {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}
.rail-list[hidden], .rail-detail[hidden] { display: none; }

.rail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.segmented { display: flex; border: 1px solid var(--line-2); border-radius: 6px; overflow: hidden; }
.seg {
  height: 24px;
  padding: 0 8px;
  border: 0;
  background: transparent;
  color: var(--text-2);
  font-size: 12px;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}
.seg + .seg { border-left: 1px solid var(--line-2); }
.seg:hover { color: var(--text); }
.seg.is-on { background: var(--panel-3); color: var(--text); }

.rows { overflow-y: auto; flex: 1; }

.row {
  display: grid;
  grid-template-columns: 24px 20px 1fr auto;
  align-items: center;
  gap: 9px;
  padding: 7px 14px;
  border-bottom: 1px solid rgba(35,35,38,.6);
  cursor: pointer;
  transition: background 120ms ease;
}
.row:hover { background: var(--panel-2); }
.row.is-selected { background: var(--panel-3); }
.row-n { font-family: var(--mono); font-size: 11px; color: var(--text-3); }
.row.is-held .row-n { color: var(--gold); }
.row-logo { width: 20px; height: 20px; border-radius: 3px; object-fit: cover; background: var(--panel-3); }
.row-main { min-width: 0; }
.row-holder { display: block; font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; }
.row-holder[href]:hover { text-decoration: underline; text-underline-offset: 2px; }
.row-sub { display: block; font-size: 11px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-bid { font-family: var(--mono); font-size: 12px; color: var(--text); font-variant-numeric: tabular-nums; }
.row.is-open .row-holder { color: var(--text-3); }
.row.is-open .row-bid { color: var(--gold); }
.row-dot { width: 20px; height: 20px; border: 1px dashed var(--line-2); border-radius: 3px; }

/* detail */
.detail-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}
.back {
  width: 24px; height: 24px;
  border: 1px solid var(--line-2);
  border-radius: 5px;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  line-height: 1;
  transition: color 120ms ease, border-color 120ms ease;
}
.back:hover { color: var(--text); border-color: #4A4A52; }
.detail-n { font-family: var(--mono); font-size: 12px; color: var(--gold); }
.detail-visit {
  margin-left: auto;
  height: 24px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line-2);
  border-radius: 5px;
  font-size: 12px;
  color: var(--text-2);
  text-decoration: none;
  transition: color 120ms ease, border-color 120ms ease;
}
.detail-visit:hover { color: var(--text); border-color: #4A4A52; }
.detail-body { padding: 14px; overflow-y: auto; flex: 1; }

.holder-card { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.holder-logo { width: 36px; height: 36px; border-radius: 5px; object-fit: cover; background: var(--panel-3); }
.holder-name { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.holder-link { font-size: 12px; color: var(--text-2); text-decoration: none; word-break: break-all; }
.holder-link:hover { color: var(--gold); }

.facts { border: 1px solid var(--line); border-radius: 6px; margin-bottom: 14px; }
.fact { display: flex; justify-content: space-between; gap: 12px; padding: 8px 11px; font-size: 12px; }
.detail-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.fact + .fact { border-top: 1px solid var(--line); }
.fact-k { color: var(--text-2); }
.fact-v { font-family: var(--mono); color: var(--text); font-variant-numeric: tabular-nums; }
.fact-v.is-gold { color: var(--gold); }

.history { margin-top: 16px; }
.history h2 { margin-bottom: 8px; color: var(--text-2); font-weight: 500; }
.hist { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; font-size: 12px; border-top: 1px solid rgba(35,35,38,.7); }
.hist-who { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-meta { font-family: var(--mono); color: var(--text-3); white-space: nowrap; }
.hist-out { color: var(--text-3); text-decoration: line-through; }

.empty { padding: 24px 14px; color: var(--text-3); font-size: 12px; }

/* ---------- modal ---------- */

.modal {
  width: min(420px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 8px 28px rgba(0,0,0,.5);
}
.modal::backdrop { background: rgba(5,5,6,.6); }
.modal-body { padding: 18px; }
.modal h2 { font-size: 16px; letter-spacing: -0.01em; margin-bottom: 4px; }
.modal-sub { color: var(--text-2); font-size: 13px; margin-bottom: 16px; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }

.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 5px; }
.field input[type=text], .field input[type=url], .field input[type=email], .field input[type=number] {
  width: 100%;
  height: 32px;
  padding: 0 9px;
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  border-radius: 6px;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color 120ms ease;
}
.field input:focus { border-color: var(--gold); }
.field-hint { font-size: 11px; color: var(--text-3); margin-top: 5px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.money { position: relative; }
.money input { padding-left: 22px; font-family: var(--mono); }
.money::before {
  content: "$";
  position: absolute;
  left: 9px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  font-family: var(--mono);
  font-size: 13px;
  pointer-events: none;
}

.drop {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px;
  border: 1px dashed var(--line-2);
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 120ms ease;
}
.drop:hover { border-color: #4A4A52; }
.drop.is-over { border-color: var(--gold); }
.drop-prev { width: 32px; height: 32px; border-radius: 4px; object-fit: cover; background: var(--panel-3); }
.drop-text { font-size: 12px; color: var(--text-2); }

.notice { font-size: 12px; padding: 9px 11px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text-2); }
.notice.is-bad { border-color: #4A2320; background: #17100F; color: #E4867B; }
.notice.is-good { border-color: #26401F; background: #0F1510; color: #92C888; }

.steps { list-style: none; padding: 0; margin: 0 0 4px; counter-reset: s; }
.steps li { position: relative; padding: 0 0 12px 26px; font-size: 13px; color: var(--text-2); counter-increment: s; }
.steps li::before {
  content: counter(s);
  position: absolute; left: 0; top: 1px;
  width: 17px; height: 17px;
  border: 1px solid var(--line-2);
  border-radius: 4px;
  font-family: var(--mono); font-size: 10px;
  color: var(--gold);
  display: grid; place-items: center;
}
.steps b { color: var(--text); font-weight: 500; }

/* ---------- eviction takeover ---------- */

.evict {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  background: rgba(5,5,6,.72);
}
.evict[hidden] { display: none; }
.evict-inner { text-align: center; }
.evict-stamp {
  display: inline-block;
  font-family: var(--mono);
  font-size: 40px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #fff;
  background: var(--red);
  padding: 6px 18px;
  border-radius: 4px;
  transform: rotate(-6deg);
  animation: slam 420ms cubic-bezier(.2,.9,.2,1);
}
@keyframes slam {
  from { transform: rotate(-6deg) scale(2.4); opacity: 0; }
  to   { transform: rotate(-6deg) scale(1); opacity: 1; }
}
.evict-line { margin: 20px 0 18px; color: var(--text); font-size: 15px; }
.evict-actions { display: flex; gap: 8px; justify-content: center; }

/* ---------- narrow screens ---------- */

@media (max-width: 860px) {
  /* Keep the complete plate as the zoom floor; the list uses the space below. */
  .city { width: 100%; height: min(52vh, 430px); aspect-ratio: auto; }
  .bar { gap: 12px; padding: 0 10px; }
  .bar-stats { display: none; }
  .rail {
    border-left: 0;
  }
  .zoomer { right: 10px; bottom: 10px; }
  .readout { left: 10px; bottom: 10px; max-width: calc(100% - 120px); }
  .ro-held { display: none; }
  .modal { width: calc(100vw - 24px); }
  .field-row { grid-template-columns: 1fr; }
  .rail-head { padding: 10px 12px; }
  .row { padding: 9px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .badge.is-outbid, .evict-stamp, .badge.is-arriving .badge-card { animation: none; }
  .rail { transition: none; }
}
