:root {
  --seat-standard: #2b6cc4;
  --seat-accessible: #1d8ad7;
  --seat-sofa: #97a4bf;
  --seat-reserved: #3c404f;
  --seat-selected: #f6c453;
  --seat-mine: #37b27c;
  --stage-bg: #141725;
}

body {
  background:
    radial-gradient(1200px 600px at 10% 0%, #e7e9f5 0%, transparent 60%),
    radial-gradient(1000px 800px at 90% 10%, #f7efe1 0%, transparent 55%),
    var(--bg);
}

.event-page {
  max-width: 1200px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 26px 22px 40px;
}

.back-link {
  font-weight: 700;
  text-decoration: none;
  color: var(--navy);
  background: white;
  border: 2px solid var(--tile-border);
  padding: 8px 14px;
  border-radius: 999px;
}

.event-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 20px;
  align-items: start;
}

.event-info {
  display: grid;
  gap: 14px;
}

.event-card {
  background: white;
  border-radius: 16px;
  border: 2px solid var(--tile-border);
  padding: 18px;
  box-shadow: var(--tile-shadow);
  display: grid;
  gap: 12px;
}

.event-card.secondary {
  background: #f7f7fb;
}

.event-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--navy);
  color: white;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  width: fit-content;
}

.event-card h1,
.event-card h2 {
  margin: 0;
  font-family: "Sora", sans-serif;
}

.event-desc {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.event-status {
  border-radius: 12px;
  border: 1px solid #f0c36b;
  background: #fff2cf;
  color: #5a4300;
  font-size: 12px;
  padding: 10px 12px;
}

.event-status[data-tone="muted"] {
  border-color: rgba(17, 19, 33, 0.2);
  background: #f2f3f8;
  color: var(--muted);
}

.event-locked .event-seats {
  opacity: 0.6;
  pointer-events: none;
}

.event-locked .reserve-btn {
  opacity: 0.6;
}

.event-empty {
  width: 100%;
  padding: 16px;
  border-radius: 12px;
  border: 1px dashed rgba(255, 255, 255, 0.35);
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  text-align: center;
}

.info-list {
  display: grid;
  gap: 10px;
}

.info-item {
  display: grid;
  gap: 4px;
}

.info-label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.info-value {
  font-weight: 600;
}

.seat-summary {
  font-weight: 700;
  font-size: 14px;
}

.seat-status {
  min-height: 18px;
  font-size: 12px;
  color: var(--navy);
}

.companion-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.companion-toggle input {
  width: auto;
}

.rules-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

.rules-toggle input {
  width: auto;
}

.rules-toggle a {
  color: var(--ink);
  text-decoration: underline;
}

.reserve-btn {
  width: 100%;
}

.reserve-btn:disabled,
.reserve-btn[disabled] {
  background: #a7afbf;
  color: #eef2f8;
  border-color: rgba(17, 19, 33, 0.25);
  box-shadow: none;
  cursor: not-allowed;
  opacity: 1;
}

.random-btn {
  margin-top: 6px;
}

.seat-map--locked .seat {
  cursor: not-allowed;
}

.seat-note {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
}

.event-seats {
  background: var(--stage-bg);
  border-radius: 18px;
  border: 2px solid var(--tile-border);
  padding: 18px;
  color: white;
  box-shadow: var(--tile-shadow);
  min-width: 0;
}

.seat-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.seat-header h2 {
  margin: 0;
  font-family: "Sora", sans-serif;
}

.seat-header p {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
}

.seat-legend {
  display: grid;
  gap: 8px;
  font-size: 12px;
  min-width: 170px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend-swatch {
  width: 18px;
  height: 14px;
  border-radius: 4px;
  background: var(--seat-standard);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.legend-swatch.accessible {
  background: var(--seat-accessible);
}

.legend-swatch.sofa {
  background: var(--seat-sofa);
}

.legend-swatch.reserved {
  background: var(--seat-reserved);
}

.legend-swatch.mine {
  background: var(--seat-mine);
}

.seat-stage {
  background: #1b1f2c;
  border-radius: 16px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

.screen {
  text-align: center;
  letter-spacing: 6px;
  text-transform: uppercase;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), transparent);
  padding: 8px 0;
  border-radius: 999px;
  margin-bottom: 14px;
}

.seat-map {
  display: grid;
  gap: 8px;
  width: max-content;
  min-width: 100%;
}

.seat-row {
  display: grid;
  grid-template-columns:
    28px
    minmax(120px, max-content)
    minmax(0, max-content)
    minmax(260px, max-content)
    minmax(0, max-content)
    minmax(120px, max-content)
    28px;
  align-items: center;
}

.row-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
  text-align: center;
}

.row-spacer {
  height: 1px;
}

.seat-block {
  display: grid;
  grid-auto-flow: column;
  --seat-size: 30px;
  --seat-gap: 6px;
  --seat-height: 24px;
  grid-auto-columns: var(--seat-size);
  gap: var(--seat-gap);
  justify-content: start;
  grid-auto-rows: var(--seat-height);
}

.seat-block.left {
  width: var(--left-width, auto);
}

.seat-block.gap-left {
  width: var(--gap-left-width, auto);
}

.seat-block.center {
  width: var(--center-width, auto);
}

.seat-block.gap-right {
  width: var(--gap-right-width, auto);
}

.seat-block.right {
  width: var(--right-width, auto);
}

.seat {
  position: relative;
  width: var(--seat-size);
  height: var(--seat-height);
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.35);
  background: var(--seat-standard);
  color: #0b0d15;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.seat::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 2px;
  right: 2px;
  height: 6px;
  border-radius: 4px 4px 2px 2px;
  background: rgba(255, 255, 255, 0.3);
}

.seat--accessible {
  background: var(--seat-accessible);
}

.seat--sofa {
  background: var(--seat-sofa);
  color: #0b0d15;
}

.seat--sofa-pair {
  grid-column: span 2;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px;
  min-width: 0;
}

.seat--sofa-pair .sofa-seat {
  width: 100%;
  height: var(--seat-height);
}

.seat--sofa-pair .sofa-seat:first-child {
  border-radius: 6px 0 0 6px;
}

.seat--sofa-pair .sofa-seat:last-child {
  border-radius: 0 6px 6px 0;
}

.seat--paired-left {
  border-radius: 0 6px 6px 0;
  margin-left: -1px;
}

.seat--paired-right {
  border-radius: 6px 0 0 6px;
  margin-right: -1px;
}

.seat--paired-left::before {
  left: 0;
  border-radius: 0 4px 2px 2px;
}

.seat--paired-right::before {
  right: 0;
  border-radius: 4px 0 2px 2px;
}

.seat--reserved {
  background: var(--seat-reserved);
  color: rgba(255, 255, 255, 0.5);
  cursor: not-allowed;
}

.seat--blocked {
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.35);
  cursor: not-allowed;
  border-color: rgba(255, 255, 255, 0.18);
}

.seat--blocked::before {
  background: rgba(255, 255, 255, 0.12);
}

.seat--mine {
  background: var(--seat-mine);
  color: #0b0d15;
  box-shadow: 0 0 0 2px rgba(55, 178, 124, 0.65);
}

.seat--mine::after {
  content: "Ty";
  position: absolute;
  top: -8px;
  right: -6px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #b2f3d8;
  color: #0b0d15;
  font-size: 9px;
  font-weight: 700;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.seat--empty {
  background: transparent;
  border: 0;
  color: transparent;
  box-shadow: none;
  opacity: 0;
  pointer-events: none;
}

.seat--empty::before {
  display: none;
}

.seat--selected {
  background: var(--seat-selected);
  color: #0b0d15;
  box-shadow: 0 0 0 2px rgba(246, 196, 83, 0.6);
}

.seat--reserved::before {
  background: rgba(255, 255, 255, 0.15);
}

@media (max-width: 1080px) {
  .event-layout {
    grid-template-columns: 1fr;
  }

  .seat-row {
    grid-template-columns:
      28px
      minmax(90px, max-content)
      minmax(0, max-content)
      minmax(200px, max-content)
      minmax(0, max-content)
      minmax(90px, max-content)
      28px;
  }
}

@media (max-width: 720px) {
  .event-page {
    padding: 16px 12px 24px;
  }

  .back-link {
    padding: 6px 10px;
    font-size: 12px;
  }

  .event-card {
    padding: 14px;
    gap: 10px;
  }

  .event-seats {
    padding: 12px;
    border-radius: 14px;
  }

  .seat-stage {
    padding: 10px;
    border-radius: 12px;
  }

  .screen {
    letter-spacing: 4px;
    margin-bottom: 10px;
  }

  .seat-header {
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 12px;
  }

  .seat-legend {
    min-width: 0;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 10px;
  }

  .seat-row {
    grid-template-columns:
      22px
      minmax(70px, max-content)
      minmax(0, max-content)
      minmax(160px, max-content)
      minmax(0, max-content)
      minmax(70px, max-content)
      22px;
  }

  .seat-block {
    --seat-size: 24px;
    --seat-gap: 4px;
    --seat-height: 20px;
  }

  .seat {
    font-size: 10px;
  }
}

@media (max-width: 520px) {
  .seat-legend {
    grid-template-columns: 1fr;
  }

  .seat-row {
    grid-template-columns:
      18px
      minmax(58px, max-content)
      minmax(0, max-content)
      minmax(132px, max-content)
      minmax(0, max-content)
      minmax(58px, max-content)
      18px;
  }

  .seat-block {
    --seat-size: 20px;
    --seat-gap: 3px;
    --seat-height: 18px;
  }

  .seat {
    border-radius: 5px;
    font-size: 9px;
  }

  .seat::before {
    top: -4px;
    left: 1px;
    right: 1px;
    height: 5px;
  }

  .seat--mine::after {
    display: none;
  }
}
