:root {
  --bg-1: #f3efe3;
  --bg-2: #e6f1ea;
  --text: #15231f;
  --muted: #4f625d;
  --card: rgba(255, 255, 255, 0.82);
  --card-border: rgba(21, 35, 31, 0.14);
  --accent: #0f766e;
  --accent-2: #ef4444;
  --shadow: 0 10px 35px rgba(21, 35, 31, 0.1);
}

body.theme-dark {
  --bg-1: #0a1619;
  --bg-2: #0f2630;
  --text: #e4f6f1;
  --muted: #9ebcb5;
  --card: rgba(10, 24, 29, 0.82);
  --card-border: rgba(174, 225, 209, 0.2);
  --accent: #14b8a6;
  --accent-2: #f87171;
  --shadow: 0 10px 35px rgba(0, 0, 0, 0.35);
}

body.theme-light {
  --bg-1: #f3efe3;
  --bg-2: #e6f1ea;
  --text: #15231f;
  --muted: #4f625d;
  --card: rgba(255, 255, 255, 0.82);
  --card-border: rgba(21, 35, 31, 0.14);
  --accent: #0f766e;
  --accent-2: #ef4444;
  --shadow: 0 10px 35px rgba(21, 35, 31, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg-1);
}

.layout {
  width: min(1200px, 100% - 2rem);
  margin: 2rem auto 3rem;
  position: relative;
  z-index: 1;
}

.top-controls {
  margin-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.left-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 0.3rem 0.4rem;
  border: 1px solid var(--card-border);
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.08);
}

.brand-logo {
  display: none;
  height: 44px;
  width: auto;
}

body.theme-dark .brand-logo-dark {
  display: block;
}

body.theme-light .brand-logo-light {
  display: block;
}

.page-nav {
  display: inline-flex;
  gap: 0.5rem;
  padding: 0.35rem;
  border: 1px solid var(--card-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.66);
}

.page-link {
  text-decoration: none;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.84rem;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
}

.page-link.active {
  color: #ffffff;
  background: var(--accent);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--muted);
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--card-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
}

.topbar {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  align-items: end;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.connection-status {
  align-self: center;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--card-border);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.14);
}

.connection-status[data-state="connected"] {
  color: #d1fae5;
  border-color: rgba(16, 185, 129, 0.45);
  background: rgba(16, 185, 129, 0.18);
}

.connection-status[data-state="connecting"],
.connection-status[data-state="reconnecting"] {
  color: #dbeafe;
  border-color: rgba(59, 130, 246, 0.4);
  background: rgba(59, 130, 246, 0.17);
}

body.theme-light .connection-status[data-state="connected"] {
  color: #065f46;
  background: rgba(16, 185, 129, 0.2);
}

body.theme-light .connection-status[data-state="connecting"],
body.theme-light .connection-status[data-state="reconnecting"] {
  color: #1e3a8a;
  background: rgba(59, 130, 246, 0.14);
}

.eyebrow {
  margin: 0;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
}

h1 {
  margin: 0.35rem 0 0;
  font-family: "Archivo Black", "Space Grotesk", sans-serif;
  font-size: clamp(1.5rem, 2vw + 1rem, 2.6rem);
  line-height: 1.05;
}

.date-control {
  display: grid;
  gap: 0.4rem;
  font-size: 0.9rem;
  font-weight: 700;
}

.date-control input {
  font: inherit;
  color: var(--text);
  border: 1px solid var(--card-border);
  border-radius: 0.7rem;
  padding: 0.55rem 0.7rem;
  min-width: 190px;
  background: #ffffffd9;
}

.timezone-toggle {
  margin: -0.5rem 0 1.2rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--card-border);
  border-radius: 0.65rem;
  background: rgba(255, 255, 255, 0.66);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.timezone-label {
  font-size: 0.84rem;
  color: var(--muted);
  font-weight: 700;
  transition: color 0.2s ease;
}

.timezone-label.active {
  color: var(--text);
}

.switch {
  position: relative;
  width: 46px;
  height: 26px;
  display: inline-block;
}

.switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.9);
  transition: background-color 0.2s ease;
}

.slider::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: var(--accent);
  transition: transform 0.2s ease;
}

.switch input:checked + .slider::before {
  transform: translateX(20px);
}

body.theme-dark .slider {
  background: rgba(255, 255, 255, 0.16);
}

body.theme-dark .page-nav {
  background: rgba(6, 17, 22, 0.88);
  border-color: rgba(174, 225, 209, 0.32);
}

body.theme-dark .page-link {
  color: #cce8e1;
}

body.theme-dark .date-control input {
  background: rgba(6, 17, 22, 0.92);
  color: #eafcf7;
  border-color: rgba(174, 225, 209, 0.34);
}

body.theme-dark .timezone-toggle {
  background: rgba(6, 17, 22, 0.88);
  border-color: rgba(174, 225, 209, 0.32);
}

body.theme-dark .timezone-label {
  color: #b9d8d1;
}

body.theme-dark .timezone-label.active {
  color: #f2fffc;
}

body.theme-dark .venue-abbr {
  background: rgba(6, 17, 22, 0.9);
  border-color: rgba(174, 225, 209, 0.34);
  color: #e9fcf6;
}

.venue-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.venue-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 1rem;
  box-shadow: var(--shadow);
  padding: 1rem;
  backdrop-filter: blur(6px);
  transform: translateY(14px);
  opacity: 0;
  animation: rise-in 0.45s ease forwards;
}

.venue-card:nth-child(2) {
  animation-delay: 0.06s;
}
.venue-card:nth-child(3) {
  animation-delay: 0.12s;
}
.venue-card:nth-child(4) {
  animation-delay: 0.18s;
}
.venue-card:nth-child(5) {
  animation-delay: 0.24s;
}
.venue-card:nth-child(6) {
  animation-delay: 0.3s;
}
.venue-card:nth-child(7) {
  animation-delay: 0.36s;
}

.venue-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
}

.venue-name {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.2;
}

.venue-domain {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  word-break: break-all;
}

.venue-abbr {
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  border: 1px solid var(--card-border);
  border-radius: 999px;
  padding: 0.25rem 0.55rem;
  background: rgba(255, 255, 255, 0.78);
}

.venue-summary {
  margin: 0.5rem 0;
  font-size: 0.95rem;
  line-height: 1.4;
}

.venue-summary.error {
  color: var(--accent-2);
  font-weight: 700;
}

.venue-details {
  border-top: 1px solid var(--card-border);
  padding-top: 0.8rem;
}

.venue-details summary {
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--accent);
}

.table-wrap {
  margin-top: 0.8rem;
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

th,
td {
  text-align: left;
  padding: 0.45rem 0.3rem;
  border-bottom: 1px solid var(--card-border);
}

th {
  font-size: 0.76rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr[style*="background-color"] td {
  border-bottom-color: rgba(255, 255, 255, 0.3);
}

.background-orb {
  position: fixed;
  border-radius: 999px;
  filter: blur(1px);
  pointer-events: none;
  z-index: 0;
}

body .background-orb {
  display: none;
}

.orb-1 {
  width: 340px;
  height: 340px;
  left: -100px;
  top: -50px;
  background: rgba(253, 230, 138, 0.35);
}

.orb-2 {
  width: 300px;
  height: 300px;
  right: -70px;
  bottom: 10%;
  background: rgba(45, 212, 191, 0.27);
}

body.theme-dark .orb-1 {
  background: rgba(13, 148, 136, 0.22);
}

body.theme-dark .orb-2 {
  background: rgba(16, 185, 129, 0.18);
}

@keyframes rise-in {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (max-width: 640px) {
  .layout {
    width: min(1200px, 100% - 1rem);
    margin-top: 1.3rem;
  }

  .venue-card {
    border-radius: 0.8rem;
  }
}
