:root {
  --bg: #05060a;
  --bg-glow: #211327;
  --panel: #0d0f16;
  --panel-2: #121622;
  --ink: #f2ede2;
  --muted: #a59f94;
  --muted-2: #8b857c;
  --amber: #f0b64f;
  --amber-deep: #c8871c;
  --teal: #48d6bf;
  --violet: #a78bfa;
  --rose: #fb7185;
  --line: #252b3d;
  --shadow: 0 24px 80px rgba(0, 0, 0, .42);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 420px at 18% -10%, rgba(240, 182, 79, .13), transparent 62%),
    radial-gradient(1100px 720px at 88% 0%, var(--bg-glow), transparent 58%),
    linear-gradient(180deg, #07080d 0%, var(--bg) 100%);
  color: var(--ink);
  font: 15px/1.55 "Avenir Next", "Segoe UI", system-ui, sans-serif;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(90deg, rgba(240, 182, 79, .028) 0 1px, transparent 1px 92px);
  mask-image: linear-gradient(180deg, #000 0%, transparent 80%);
}

.skip-link {
  position: fixed;
  left: 16px;
  top: 16px;
  z-index: 100;
  transform: translateY(-160%);
  background: var(--amber);
  color: #171006;
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 700;
  transition: transform .2s ease-out;
}
.skip-link:focus { transform: translateY(0); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 6, 10, .84);
  backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(240, 182, 79, .45);
  border-radius: 10px 10px 2px 2px;
  background: linear-gradient(160deg, rgba(240, 182, 79, .2), rgba(240, 182, 79, .03));
  color: var(--amber);
  font-size: 22px;
  line-height: 1;
  box-shadow: 0 0 28px rgba(240, 182, 79, .14);
}
.brand h1 {
  margin: 0;
  font: 650 19px/1.1 Georgia, "Times New Roman", serif;
  letter-spacing: .16em;
}
.tagline {
  margin: 3px 0 0;
  color: var(--muted);
  font: 600 11px/1.2 ui-monospace, "SF Mono", Menlo, monospace;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.status {
  flex: 0 1 auto;
  max-width: 58vw;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(18, 22, 34, .75);
  color: var(--muted);
  font: 600 12px/1.25 ui-monospace, "SF Mono", Menlo, monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.status.ok { color: var(--teal); border-color: rgba(72, 214, 191, .5); }
.status.fallback { color: var(--amber); border-color: rgba(240, 182, 79, .5); }

main {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 22px 28px 30px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  grid-template-areas: "hero hero" "left right";
  gap: 18px;
}
.hero {
  grid-area: hero;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(270px, .6fr);
  gap: 18px;
  align-items: stretch;
  border: 1px solid rgba(240, 182, 79, .24);
  border-radius: 20px;
  padding: 22px;
  background:
    linear-gradient(135deg, rgba(240, 182, 79, .1), transparent 42%),
    linear-gradient(180deg, rgba(18, 22, 34, .9), rgba(10, 12, 18, .92));
  box-shadow: var(--shadow);
}
.eyebrow, .overline {
  margin: 0 0 7px;
  color: var(--amber);
  font: 700 11px/1 ui-monospace, "SF Mono", Menlo, monospace;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.hero h2 {
  max-width: 900px;
  margin: 0;
  font: 520 clamp(29px, 4vw, 48px)/1.04 Georgia, "Times New Roman", serif;
  letter-spacing: -.02em;
}
.hero-copy {
  max-width: 720px;
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 15.5px;
}
.hero-prompt {
  position: relative;
  align-self: center;
  padding: 17px 17px 17px 20px;
  border: 1px dashed rgba(240, 182, 79, .45);
  border-radius: 14px;
  background: rgba(240, 182, 79, .06);
  color: var(--ink);
}
.prompt-label {
  display: block;
  margin-bottom: 8px;
  color: var(--amber);
  font: 700 11px/1 ui-monospace, "SF Mono", Menlo, monospace;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.hero-prompt p { margin: 0; font-size: 14.5px; line-height: 1.45; }

.left, .right { min-width: 0; }
.left { grid-area: left; }
.right { grid-area: right; }
.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: end;
  margin-bottom: 12px;
}
.section-head h2 {
  margin: 0;
  font: 560 clamp(24px, 3vw, 36px)/1.1 Georgia, "Times New Roman", serif;
  letter-spacing: -.01em;
}
#seatmap-heading { scroll-margin-top: 90px; }
#perf-when { margin: 5px 0 0; color: var(--muted); font-size: 13.5px; }
.perf-switch select {
  width: min(300px, 100%);
  min-height: 40px;
  background: var(--panel-2);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 36px 8px 11px;
  font: inherit;
  font-size: 13px;
}

.inspector {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "kick seat action" "meta meta meta";
  gap: 5px 14px;
  align-items: center;
  min-height: 74px;
  margin-bottom: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--amber);
  border-radius: 12px;
  background: rgba(13, 15, 22, .82);
}
#inspector-kicker {
  grid-area: kick;
  color: var(--muted);
  font: 700 11px/1.2 ui-monospace, "SF Mono", Menlo, monospace;
  letter-spacing: .09em;
  text-transform: uppercase;
}
#inspector-seat {
  grid-area: seat;
  overflow: hidden;
  font: 600 20px/1.15 Georgia, "Times New Roman", serif;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#inspector-meta {
  grid-area: meta;
  color: var(--muted);
  font: 600 12px/1.4 ui-monospace, "SF Mono", Menlo, monospace;
}
#inspector-action {
  grid-area: action;
  justify-self: end;
  color: var(--amber);
  font-size: 12.5px;
  font-weight: 700;
}
.inspector.agent-hold { border-left-color: var(--amber); box-shadow: 0 0 24px rgba(240, 182, 79, .1); }
.inspector.human-hold { border-left-color: var(--violet); }
.inspector.cart { border-left-color: var(--teal); }
.inspector.sold { border-left-color: var(--muted-2); opacity: .75; }

.map-shell {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    radial-gradient(420px 150px at 50% 8%, rgba(240, 182, 79, .08), transparent 72%),
    linear-gradient(180deg, rgba(28, 34, 51, .97), #151b29);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .02), var(--shadow);
}
.seatmap {
  aspect-ratio: 560 / 620;
  padding: 12px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-color: rgba(240, 182, 79, .5) transparent;
}
#seatmap-svg {
  display: block;
  width: 100%;
  min-width: 0;
  height: auto;
}
.map-hint {
  margin: 0;
  padding: 0 14px 12px;
  color: var(--muted-2);
  font: 600 11px/1.3 ui-monospace, "SF Mono", Menlo, monospace;
  letter-spacing: .04em;
}

.stage {
  fill: rgba(240, 182, 79, .06);
  stroke: rgba(240, 182, 79, .34);
}
.stage-label, .section-label {
  fill: var(--muted);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.stage-label { font-size: 12px; letter-spacing: 7px; }
.section-label { font-size: 10.5px; letter-spacing: 3px; }

.seat { cursor: pointer; }
.seat .hit { fill: transparent; }
.seat .hold-ring { fill: none; stroke: transparent; }
.seat .visual {
  fill: #93a6c9;
  stroke: transparent;
  transition: fill .16s ease-out, opacity .16s ease-out;
}
.seat.available:hover .visual, .seat:focus .visual { fill: #b6c5e4; }
.seat:focus { outline: none; }
.seat:focus .visual { stroke: #fff4d6; stroke-width: 2.4; }
.seat.sold { cursor: not-allowed; }
.seat.sold .visual {
  fill: #242b39;
  stroke: #3b4455;
  stroke-width: 1.4;
  stroke-dasharray: 2.4 2.8;
  opacity: .82;
}
.seat.cart .visual {
  fill: var(--teal);
  stroke: #9df0e5;
  stroke-width: 2.2;
}
.seat.held-human .visual {
  fill: var(--violet);
  stroke: #d8ccff;
  stroke-width: 2.4;
}
.seat.held-agent .visual {
  fill: var(--amber);
  stroke: #ffe0a3;
  stroke-width: 2.4;
}
.seat.held-agent .hold-ring, .seat.held-human .hold-ring {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  opacity: .75;
  transform-box: fill-box;
  transform-origin: center;
  animation: hold-ring 1.35s ease-out infinite;
}
.seat.held-agent .hold-ring { color: var(--amber); }
.seat.held-human .hold-ring { color: var(--violet); }
@keyframes hold-ring {
  0% { transform: scale(.72); opacity: .82; }
  72%, 100% { transform: scale(1.72); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .seat.held-agent .hold-ring, .seat.held-human .hold-ring { animation: none; opacity: .42; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  margin: 10px 2px 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font: 600 12px/1.4 ui-monospace, "SF Mono", Menlo, monospace;
}
.legend li { display: inline-flex; align-items: center; min-height: 24px; }
.dot { width: 10px; height: 10px; margin-right: 7px; border-radius: 50%; display: inline-block; }
.dot.available { background: #6f7f9f; }
.dot.held-agent { background: var(--amber); }
.dot.held-human { background: var(--violet); }
.dot.cart { background: var(--teal); }
.dot.sold { background: #242b39; border: 1px dashed #3b4455; }

.panel {
  margin-bottom: 13px;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: linear-gradient(180deg, rgba(18, 22, 34, .9), rgba(13, 15, 22, .94));
  box-shadow: 0 12px 42px rgba(0, 0, 0, .2);
}
.panel h3 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 11px;
  color: var(--muted);
  font: 700 11.5px/1.2 ui-monospace, "SF Mono", Menlo, monospace;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.hint { color: var(--muted-2); font-size: 10.5px; font-weight: 600; letter-spacing: 0; text-transform: none; }
.steps { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.steps li {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 9px;
  align-items: center;
}
.steps span {
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(240, 182, 79, .12);
  color: var(--amber);
  font: 800 12px/1 ui-monospace, "SF Mono", Menlo, monospace;
}
.steps strong { font-size: 13.5px; }
.steps small { color: var(--muted); font-size: 12px; line-height: 1.35; }

.list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 28px;
  padding: 5px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 13.5px;
}
.list li:last-child { border-bottom: 0; }
.list .empty { justify-content: center; min-height: 30px; border: 0; color: var(--muted-2); font-size: 12.5px; }
.hold .seat-id, #cart-list li > span:first-child { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12.5px; }
.hold .by { color: var(--muted); font-size: 12px; }
.hold .ttl, .cart .ttl { color: var(--amber); font: 700 12px/1 ui-monospace, "SF Mono", Menlo, monospace; font-variant-numeric: tabular-nums; }
.hold.agent { color: var(--amber); }
.hold.human { color: var(--violet); }
.order { flex-wrap: wrap; line-height: 1.4; }
.order .status { color: var(--teal); font-weight: 700; }

.activity {
  max-height: 190px;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
  color: var(--muted);
  font-size: 12.5px;
  scrollbar-color: rgba(240, 182, 79, .5) transparent;
}
.activity li { padding: 5px 0; border-bottom: 1px dashed var(--line); line-height: 1.35; }
.activity li:last-child { border-bottom: 0; }
.activity li.agent { color: var(--amber); }
.activity li.hold, .activity li.human { color: var(--violet); }
.activity li.cart, .activity li.checkout { color: var(--teal); }
.activity li.error { color: var(--rose); }

.promo { display: flex; gap: 8px; margin: 11px 0; }
input {
  min-width: 0;
  flex: 1;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #090b11;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
}
input:focus, select:focus, button:focus-visible {
  outline: 2px solid rgba(240, 182, 79, .72);
  outline-offset: 2px;
}
button {
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #1a2030;
  color: var(--ink);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: transform .14s ease-out, background .14s ease-out, border-color .14s ease-out;
}
button:hover { background: #242c42; transform: translateY(-1px); }
button:active { transform: translateY(0); }
button.primary {
  border-color: var(--amber);
  background: linear-gradient(180deg, #f5c86c, var(--amber));
  color: #1a1206;
}
button.primary:hover { border-color: #ffd88f; background: linear-gradient(180deg, #ffd88f, #f2b441); }
button:disabled { cursor: not-allowed; opacity: .42; transform: none; }
.totals { color: var(--muted); font-size: 13.5px; }
.totals div { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; }
.totals .discount { color: var(--teal); }
.totals .grand {
  margin-top: 5px;
  padding-top: 7px;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-weight: 800;
}
.actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 12px; }
.actions .primary { flex: 1 1 140px; }
.cart-remove {
  min-width: 28px;
  min-height: 28px;
  padding: 0 5px;
  border: 0;
  background: transparent;
  color: var(--muted-2);
  font-size: 15px;
}
.cart-remove:hover { background: transparent; color: var(--rose); }

.tools summary { color: var(--muted); cursor: pointer; font-size: 12.5px; }
.tools ul { columns: 2; margin: 9px 0 0; padding: 0; list-style: none; font: 11px/1.7 ui-monospace, "SF Mono", Menlo, monospace; }
.tools code { color: var(--amber); }

dialog {
  width: min(390px, calc(100vw - 28px));
  padding: 22px;
  border: 1px solid rgba(240, 182, 79, .38);
  border-radius: 16px;
  background: linear-gradient(180deg, #151926, #0d0f16);
  color: var(--ink);
  box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(2, 3, 6, .78); backdrop-filter: blur(4px); }
dialog h3 { margin: 0 0 8px; font: 600 23px/1.1 Georgia, "Times New Roman", serif; }
dialog label { display: block; margin: 14px 0 4px; color: var(--muted); font-size: 13px; }
dialog input { width: 100%; margin-top: 7px; }
#checkout-summary { margin: 0; color: var(--muted); line-height: 1.45; }

.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;
}
.toast {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 50;
  max-width: min(360px, calc(100vw - 36px));
  padding: 12px 15px;
  border: 1px solid rgba(240, 182, 79, .42);
  border-left: 4px solid var(--amber);
  border-radius: 12px;
  background: rgba(13, 15, 22, .96);
  color: var(--ink);
  box-shadow: var(--shadow);
  font-size: 13.5px;
}

@media (max-width: 1120px) {
  main {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "hero" "left" "right";
  }
  .right {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 14px;
  }
  .panel { break-inside: avoid; }
}

@media (max-width: 680px) {
  .site-header { position: static; align-items: flex-start; gap: 10px; min-height: 71px; padding: 13px 14px; }
  .brand { flex: 1 1 auto; }
  .brand-mark { width: 33px; height: 33px; border-radius: 8px 8px 2px 2px; font-size: 19px; }
  .brand h1 { font-size: 16px; }
  .tagline { font-size: 9.5px; }
  .status {
    flex: 0 1 auto;
    max-width: 48vw;
    padding: 6px 8px;
    font-size: 10.5px;
    text-align: right;
    white-space: normal;
  }
  main { padding: 14px 14px 22px; gap: 14px; }
  .hero { grid-template-columns: 1fr; padding: 17px; border-radius: 16px; }
  .hero h2 { font-size: clamp(27px, 9vw, 36px); }
  .hero-copy { font-size: 14px; }
  .hero-prompt { padding: 14px; }
  .section-head { grid-template-columns: 1fr; align-items: start; min-height: 204px; }
  .perf-switch select { width: 100%; max-width: none; }
  .inspector {
    grid-template-columns: 1fr;
    grid-template-areas: "kick" "seat" "meta" "action";
    min-height: 0;
    padding: 11px 12px;
  }
  #inspector-action { justify-self: start; }
  .seatmap { aspect-ratio: auto; min-height: 968px; padding: 8px; }
  #seatmap-svg { width: 860px; min-width: 860px; }
  .right { grid-template-columns: 1fr; }
  .activity { max-height: 160px; }
  .tools ul { columns: 1; }
}

@media (min-width: 681px) and (max-width: 1120px) {
  .hero { grid-template-columns: 1fr; }
}
