:root {
  --navy: #0b1f3a;
  --navy-2: #12294a;
  --blue: #1f6feb;
  --blue-line: #2b7fff;
  --silver: #c9d1d9;
  --ink: #1a1f2b;
  --paper: #f4f6f9;
  --sold: #9aa4b2;
  --sold-fill: rgba(120, 132, 148, 0.92);
  --reserved: #35507a;
  --available: #1f6feb;
  --radius: 10px;
  --shadow: 0 8px 30px rgba(11, 31, 58, 0.16);
  font-synthesis-weight: none;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.chart {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px 40px;
}

/* Header */
.chart__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #fff;
  border-radius: var(--radius);
  border-left: 6px solid var(--blue-line);
  padding: 20px 24px;
  margin: 20px 0 16px;
}
.chart__titles h1 {
  margin: 0 0 4px;
  font-size: 22px;
  letter-spacing: 0.02em;
}
.chart__titles p {
  margin: 0;
  color: var(--silver);
  font-size: 13px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  border: 0;
}
.btn--ga {
  background: #fff;
  color: var(--navy);
  white-space: nowrap;
}
.btn--ga span { color: var(--blue); }
.btn--ga:hover { background: var(--silver); }
.btn--primary {
  background: var(--blue);
  color: #fff;
  width: 100%;
  justify-content: center;
  font-size: 15px;
  padding: 13px 18px;
}
.btn--primary:hover { background: #1a5fd0; }

/* Toolbar */
.chart__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.chart__tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab {
  background: #e6eaf0;
  border: 1px solid transparent;
  color: var(--navy);
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.tab:hover { background: #dbe1ea; }
.tab.is-active {
  background: var(--navy);
  color: #fff;
}

.chart__legend {
  display: flex;
  gap: 14px;
  font-size: 12px;
  color: #4a5568;
}
.lg { display: inline-flex; align-items: center; gap: 6px; }
.lg::before {
  content: "";
  width: 12px; height: 12px;
  border-radius: 50%;
  display: inline-block;
}
.lg--available::before { background: var(--available); }
.lg--sold::before { background: var(--sold); }
.lg--reserved::before { background: var(--reserved); }

/* Stage / floor image */
.chart__stage {
  position: relative;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  overflow: hidden;
}
.stage__inner {
  position: relative;
  width: 100%;
  line-height: 0;
}
#floorImg {
  width: 100%;
  height: auto;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}
#floorImg[hidden] { display: none; }

/* ---- Bar-stool view (HTML, not a floor plan) ---- */
.stools {
  padding: 8px 4px 20px;
  position: relative;
  overflow: hidden;
}
.stools__title {
  text-align: center;
  color: #c0392b;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 6px 0 22px;
}
.stools__body {
  display: grid;
  grid-template-columns: auto auto auto;
  justify-content: center;
  align-items: start;
  gap: 0 10px;
  width: fit-content;
  margin: 0 auto;
}
.stools__heading {
  text-align: center;
  color: #c0392b;
  font-size: 15px;
  font-weight: 800;
  margin: 0 0 12px;
}
.stools__col { display: flex; flex-direction: column; gap: 7px; }
.stools__col--left { align-items: flex-end; }
.stools__col--right { align-items: flex-start; }
.stools__rail {
  width: 8px;
  align-self: stretch;
  margin-top: 32px;
  border-left: 2px solid var(--ink);
  border-right: 2px solid var(--ink);
}
.stools__stage {
  position: absolute;
  right: 10px;
  top: 52%;
  transform: translateY(-50%) rotate(90deg);
  transform-origin: center;
  color: #c0392b;
  font-weight: 800;
  letter-spacing: 0.2em;
  font-size: 14px;
  pointer-events: none;
}
@media (max-width: 640px) { .stools__stage { display: none; } }

.stool {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: none;
  padding: 3px;
  cursor: pointer;
  font: inherit;
  color: var(--ink);
}
.stools__col--right .stool { flex-direction: row-reverse; }
.stool__label { font-size: 13px; font-weight: 600; white-space: nowrap; }
.stool__seat {
  width: 46px;
  height: 30px;
  flex-shrink: 0;
  background: #eef1f5;
  border: 1.5px solid #9aa4b2;
  border-radius: 6px 20px 20px 6px;   /* D-shape: bulge toward the rail (right) */
}
.stools__col--right .stool__seat { border-radius: 20px 6px 6px 20px; }

.stool--available .stool__seat { background: var(--available); border-color: #1a5fd0; }
.stool--available:hover .stool__seat { background: #3b82f6; }
.stool--sold { cursor: not-allowed; }
.stool--sold .stool__seat { background: #c4cbd4; }
.stool--sold .stool__label { color: #8a94a2; }
.stool--held .stool__seat { background: #e0a53b; border-color: #b9822a; }

@media (prefers-color-scheme: dark) {
  .stool__seat { background: #2a3550; border-color: #54607a; }
  .stools__rail { border-color: #c9d1d9; }
  .stool--sold .stool__seat { background: #3a4560; }
}

@media (max-width: 520px) {
  .stools__stage { display: none; }
  .stool__seat { width: 38px; }
}
.hotspots {
  position: absolute;
  inset: 0;
}
.chart__loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  font-size: 14px;
  background: #fff;
}
.chart__stage.is-ready .chart__loading { display: none; }

/* Hotspots */
.hs {
  position: absolute;
  transform: translate(-50%, -50%);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  transition: box-shadow 0.12s ease, transform 0.12s ease;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  padding: 0;
  margin: 0;
}
.hs > span {
  display: block;
  line-height: 1;
  text-align: center;
  pointer-events: none;
}
.hs--available {
  background: var(--available);
}
.hs--available:hover {
  box-shadow: 0 0 0 4px rgba(31, 111, 235, 0.35);
  transform: translate(-50%, -50%) scale(1.08);
  z-index: 5;
}
.hs--sold {
  background: var(--sold-fill);
  cursor: not-allowed;
  color: #eef1f4;
  font-size: 9px;
}
.hs--held {
  background: rgba(180, 130, 40, 0.92);
  cursor: not-allowed;
  font-size: 9px;
}
.hs--reserved {
  background: var(--reserved);
  cursor: default;
  font-size: 9px;
  opacity: 0.9;
}
.hs--dim { opacity: 0.25; pointer-events: none; }

/* Tooltip */
.tip {
  position: absolute;
  transform: translate(-50%, calc(-100% - 12px));
  background: var(--navy);
  color: #fff;
  padding: 8px 11px;
  border-radius: 7px;
  font-size: 12px;
  line-height: 1.35;
  white-space: nowrap;
  pointer-events: none;
  z-index: 20;
  box-shadow: var(--shadow);
}
.tip strong { display: block; font-size: 12.5px; }
.tip span { color: var(--silver); }
.tip::after {
  content: "";
  position: absolute;
  left: 50%; top: 100%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--navy);
}

.chart__note {
  margin: 14px 2px 0;
  font-size: 12px;
  color: #6b7280;
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 20px);
  background: var(--navy);
  color: #fff;
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  max-width: min(90vw, 420px);
  text-align: center;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 200;
}
.toast.is-shown {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(11, 31, 58, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}
.modal[hidden] { display: none; }
.modal__box {
  background: #fff;
  border-radius: 12px;
  max-width: 380px;
  width: 100%;
  padding: 26px;
  position: relative;
  box-shadow: var(--shadow);
}
.modal__close {
  position: absolute;
  top: 10px; right: 12px;
  border: 0;
  background: none;
  font-size: 24px;
  line-height: 1;
  color: #9aa4b2;
  cursor: pointer;
}
.modal__box h2 {
  margin: 0 0 14px;
  font-size: 19px;
  color: var(--navy);
}
.modal__meta {
  margin: 0 0 18px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 14px;
  font-size: 14px;
}
.modal__meta dt { color: #6b7280; }
.modal__meta dd { margin: 0; font-weight: 600; }
.modal__fineprint {
  margin: 10px 0 0;
  font-size: 11.5px;
  color: #9aa4b2;
  text-align: center;
}

@media (max-width: 620px) {
  .chart__header { padding: 16px; }
  .chart__titles h1 { font-size: 18px; }
  .btn--ga { width: 100%; justify-content: center; }
  .chart__toolbar { flex-direction: column; align-items: stretch; }

  /* keep tabs on one swipeable row */
  .chart__tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  .chart__tabs::-webkit-scrollbar { display: none; }
  .tab { white-space: nowrap; flex: 0 0 auto; }

  /* let the floor-plan bitmap stay large enough to tap; swipe horizontally.
     the stool view is fluid HTML, so exclude it. */
  .chart__stage:has(#floorImg:not([hidden])) {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .stage__inner:has(#floorImg:not([hidden])) { min-width: 560px; }

  .stools__title { font-size: 16px; }
  .stool__label { font-size: 11px; }
  .stool__seat { width: 34px; height: 26px; }
  .stools__body { gap: 0 6px; }
}
