:root {
  color-scheme: dark;
  --bg: #090d12;
  --panel: #111821;
  --panel2: #182230;
  --text: #f4f7fb;
  --muted: #91a0b2;
  --green: #48d597;
  --blue: #58a6ff;
  --orange: #ffad42;
  --line: #273446;
  --accent: #d9ff63;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-width: 100%; min-height: 100%; background: var(--bg); color: var(--text); font-family: Inter, ui-sans-serif, system-ui, sans-serif; }
body { overflow: hidden; }
button, input { font: inherit; color: inherit; }
#app { height: 100vh; display: grid; grid-template-rows: auto auto auto 1fr; gap: 12px; padding: 18px 22px; max-width: 1900px; margin: auto; }
#lot { position: relative; min-height: 120px; padding: 16px 20px; background: linear-gradient(120deg, #172231, #101720); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
#lot.reading, #lot.ended { opacity: .55; }
#ribbon { position: absolute; right: -42px; top: 19px; width: 170px; text-align: center; padding: 7px; background: var(--accent); color: #182000; font-weight: 900; transform: rotate(35deg); }
#lot.ended #ribbon { background: var(--orange); }
.eyebrow { color: var(--muted); font-size: 13px; font-weight: 900; letter-spacing: .16em; text-transform: uppercase; }
#connection { margin-left: 8px; color: #ff7b72; }
#connection.online { color: var(--green); }
#join { display: flex; gap: 8px; position: absolute; right: 72px; top: 12px; }
#join input, #join button, #scale { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; }
#join input { width: min(430px, 45vw); }
#waiting { font-size: clamp(25px, 3vw, 48px); font-weight: 800; color: var(--muted); margin-top: 15px; }
.identity-main { display: flex; gap: 18px; align-items: baseline; }
.identity-main #card-name { font-size: clamp(30px, 4vw, 66px); font-weight: 900; }
.identity-main #card-number { font-size: clamp(20px, 2vw, 34px); color: var(--muted); }
.identity-detail { display: flex; gap: 8px; flex-wrap: wrap; }
.identity-detail span { background: #202c3b; border-radius: 999px; padding: 5px 11px; }
.identity-detail #tier-badge { background: var(--accent); color: #172000; font-weight: 900; }
.identity-detail #age { background: transparent; color: var(--muted); margin-left: auto; }
#last-sale { display: flex; align-items: center; gap: 9px; margin-top: 10px; color: var(--muted); font-size: 14px; }
#last-sale[hidden] { display: none; }
#last-sale strong { color: var(--text); }
#last-sale span { padding: 3px 8px; border: 1px solid var(--line); border-radius: 999px; }
#last-sale #last-sale-price { border: 0; padding: 0; }
#last-sale-verified.verified { color: var(--green); border-color: var(--green); }
#banner { padding: 9px 14px; border: 1px solid #805b22; background: #402d12; border-radius: 10px; }
.pro-area, .chart-panel { position: relative; }
.tier-area { min-height: 116px; }
#tiers { display: flex; gap: 11px; overflow-x: auto; min-height: 116px; }
.tier-card { min-width: 180px; flex: 1; border: 1px solid var(--line); background: var(--panel); border-radius: 14px; padding: 12px 15px; text-align: left; }
.tier-card:first-child { box-shadow: inset 0 3px 0 var(--accent); }
.tier-name { font-size: 13px; color: var(--muted); font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.tier-price { font-size: clamp(27px, 2.5vw, 42px); font-weight: 900; }
.tier-meta, .tier-delta { font-size: 13px; color: var(--muted); margin-top: 3px; }
.tier-delta.positive { color: var(--green); }
.tier-delta.negative { color: #ff7b72; }
.chart-panel { min-height: 0; display: grid; grid-template-rows: auto auto 1fr auto; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 15px 18px; }
.chart-head { display: flex; justify-content: space-between; align-items: center; }
.chart-head h1 { margin: 2px 0; font-size: clamp(23px, 2.2vw, 38px); }
#legend { display: flex; gap: 22px; min-height: 35px; align-items: center; color: var(--muted); }
.legend-item { display: flex; align-items: center; gap: 7px; }
.swatch { width: 24px; height: 4px; border-radius: 3px; }
.canvas-wrap { position: relative; min-height: 220px; }
#chart { width: 100%; height: 100%; display: block; }
#chart-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: clamp(20px, 2vw, 34px); color: var(--muted); }
#tooltip { position: absolute; pointer-events: none; background: #03070bdc; border: 1px solid #65758a; border-radius: 9px; padding: 8px 10px; white-space: nowrap; transform: translate(10px, -105%); }
.disclaimer { color: var(--muted); font-size: 12px; margin: 2px 0 0; }
@media (max-width: 750px) {
  body { overflow: auto; }
  #app { height: auto; min-height: 100vh; padding: 10px; grid-template-rows: auto auto auto minmax(470px, 1fr); }
  #lot { padding-top: 65px; }
  .identity-main { display: block; }
  #join { left: 12px; right: 12px; top: 12px; }
  #join input { width: 100%; }
  .chart-panel { min-height: 520px; }
}
