:root {
  color-scheme: dark;
  --bg: #030303;
  --text: #f4f6f7;
  --muted: #b7bdc1;
  --soft: rgba(255, 255, 255, 0.72);
  --line: rgba(255, 255, 255, 0.18);
  --line-strong: rgba(255, 255, 255, 0.35);
  --surface: rgba(7, 8, 9, 0.66);
  --surface-strong: rgba(9, 10, 12, 0.86);
  --accent: #ffffff;
  --danger: #d34040;
  --max: 1120px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--text);
  font-family: "Trebuchet MS", "Arial Narrow", Arial, sans-serif;
  line-height: 1.5;
  letter-spacing: 0;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -4;
  content: "";
  background: #020202;
}

a {
  color: inherit;
}

img,
video {
  display: block;
  max-width: 100%;
}

.background-video,
.background-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.background-video {
  z-index: -3;
  object-fit: cover;
  object-position: center center;
  opacity: 0.68;
  filter: grayscale(1) contrast(1.22) brightness(0.82);
}

.background-overlay {
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.86), rgba(0, 0, 0, 0.5) 48%, rgba(0, 0, 0, 0.84)),
    linear-gradient(180deg, rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.76) 70%, #020202),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 5px);
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(calc(100% - 32px), var(--max));
  margin: 0 auto;
  padding: 24px 0 18px;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  width: clamp(170px, 28vw, 310px);
  min-width: 0;
}

.brand img {
  width: 100%;
  filter: drop-shadow(0 0 22px rgba(255, 255, 255, 0.2));
}

.site-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 5px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(10px);
}

.site-nav a {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
  background: transparent;
}

.site-nav a[aria-current="page"],
.site-nav a:hover {
  border-color: var(--line-strong);
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.site-main {
  width: min(calc(100% - 32px), var(--max));
  margin: 0 auto;
  padding: clamp(8px, 2vw, 22px) 0 70px;
}

.intro {
  display: grid;
  min-height: clamp(180px, 27vh, 300px);
  max-width: 860px;
  align-content: center;
  padding: clamp(8px, 2vw, 20px) 0 clamp(10px, 2vw, 22px);
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--text);
  font-size: 0.83rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 18px;
  font-size: clamp(2.2rem, 5.8vw, 4.7rem);
  line-height: 0.92;
  text-transform: uppercase;
  text-shadow: 0 18px 42px rgba(0, 0, 0, 0.68);
}

.intro p:last-child {
  max-width: 640px;
  margin-bottom: 0;
  color: rgba(244, 246, 247, 0.86);
  font-size: clamp(1rem, 2vw, 1.18rem);
}

body[data-page="past"] .intro {
  opacity: 0.92;
}

body[data-page="past"] .eyebrow::after {
  display: inline-block;
  width: 64px;
  height: 1px;
  margin-left: 12px;
  vertical-align: middle;
  content: "";
  background: var(--line-strong);
}

body[data-page="admin"] .intro {
  min-height: 0;
  padding: clamp(28px, 6vw, 62px) 0 0;
}

.shows-shell {
  margin-top: clamp(10px, 2vw, 24px);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.section-heading h2 {
  margin: 0;
  font-size: 0.86rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

.section-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.shows-list {
  display: grid;
  gap: 12px;
}

.year-accordion {
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.38);
}

.year-accordion[open] {
  border-color: var(--line-strong);
  background: rgba(0, 0, 0, 0.5);
}

.year-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 54px;
  padding: 0 18px;
  color: var(--text);
  font-weight: 800;
  text-transform: uppercase;
  cursor: pointer;
}

.year-summary::-webkit-details-marker {
  display: none;
}

.year-summary::after {
  content: "+";
  color: var(--muted);
  font-size: 1.3rem;
  line-height: 1;
}

.year-accordion[open] .year-summary::after {
  content: "-";
}

.year-summary span:last-child {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.82rem;
}

.year-shows {
  display: grid;
  gap: 12px;
  padding: 0 12px 12px;
}

.show-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(82px, 0.14fr) minmax(0, 1fr) auto;
  align-items: center;
  min-height: 126px;
  gap: clamp(18px, 4vw, 34px);
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(12px);
}

.show-card:hover {
  border-color: var(--line-strong);
  background: var(--surface-strong);
}

.show-card--next {
  border-color: rgba(255, 255, 255, 0.52);
  background: rgba(13, 14, 16, 0.84);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 0 34px rgba(255, 255, 255, 0.1),
    0 24px 78px rgba(0, 0, 0, 0.36);
}

.show-status {
  margin: 0 0 8px;
  color: var(--soft);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.1;
  text-transform: uppercase;
  white-space: nowrap;
}

.show-date {
  display: grid;
  justify-items: start;
  min-width: 78px;
  padding-right: 18px;
  border-right: 1px solid var(--line);
  font-weight: 800;
  text-transform: uppercase;
}

.show-month,
.show-year {
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0;
}

.show-day {
  margin: 2px 0;
  font-size: clamp(2.25rem, 5vw, 3.35rem);
  line-height: 0.95;
}

.show-location,
.show-time,
.show-lineup,
.show-notes {
  margin: 0;
  color: var(--muted);
}

.show-title-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: clamp(10px, 2vw, 16px);
}

.show-title-row > div:first-child {
  min-width: 0;
}

.show-location {
  color: var(--muted);
  font-size: clamp(0.95rem, 1.9vw, 1.3rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
  text-transform: uppercase;
}

.show-venue {
  margin: 0 0 8px;
  color: var(--text);
  font-size: clamp(1.15rem, 2.4vw, 1.7rem);
  line-height: 1;
  text-transform: uppercase;
}

.show-time,
.show-lineup,
.show-notes {
  font-size: 0.95rem;
}

.show-time {
  color: var(--soft);
  font-weight: 800;
}

.show-lineup {
  margin-top: 6px;
}

.show-notes {
  margin-top: 6px;
  color: var(--soft);
}

.show-age {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.age-image-badge {
  width: clamp(68px, 8vw, 98px);
  height: auto;
  filter: drop-shadow(0 0 18px rgba(255, 255, 255, 0.12));
}

.age-text-badge {
  display: inline-flex;
  min-width: 64px;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 800;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.08);
}

.show-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.button {
  display: inline-flex;
  min-width: 112px;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-decoration: none;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.09);
  cursor: pointer;
}

.button:hover {
  color: #050505;
  background: var(--accent);
}

.button--primary {
  border-color: var(--accent);
  color: #050505;
  background: var(--accent);
  box-shadow: 0 0 22px rgba(255, 255, 255, 0.12);
}

.button--primary:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
}

.button:disabled,
.button[aria-disabled="true"] {
  color: rgba(255, 255, 255, 0.48);
  background: rgba(255, 255, 255, 0.04);
  cursor: not-allowed;
  pointer-events: none;
}

.empty-state,
.error-state {
  padding: clamp(26px, 6vw, 46px);
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.56);
  color: var(--muted);
}

.empty-state h3,
.error-state h3 {
  margin-bottom: 8px;
  color: var(--text);
  font-size: 1.5rem;
  text-transform: uppercase;
}

.tool-shell {
  margin-top: clamp(44px, 8vw, 78px);
}

.upload-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 16px;
}

.upload-panel,
.field-guide {
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.56);
}

.upload-panel {
  padding: clamp(18px, 3vw, 28px);
}

.upload-drop {
  display: grid;
  gap: 8px;
  min-height: 146px;
  align-content: center;
  justify-items: center;
  padding: 22px;
  border: 1px dashed var(--line-strong);
  color: var(--text);
  text-align: center;
  cursor: pointer;
}

.upload-drop span {
  font-size: 1.35rem;
  font-weight: 800;
  text-transform: uppercase;
}

.upload-drop small,
.field-guide p {
  color: var(--muted);
}

#csv-file {
  width: 100%;
  margin-top: 14px;
}

.tool-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.field-guide {
  padding: clamp(18px, 3vw, 28px);
}

.field-guide h3 {
  margin-bottom: 8px;
  text-transform: uppercase;
}

.field-guide code {
  display: block;
  overflow-x: auto;
  padding: 14px;
  border: 1px solid var(--line);
  color: var(--soft);
  background: rgba(255, 255, 255, 0.06);
  white-space: nowrap;
}

.message-list {
  margin-top: 16px;
}

.message-list ul {
  margin: 0;
  padding-left: 20px;
}

.preview-label {
  display: block;
  margin: 22px 0 8px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
  text-transform: uppercase;
}

.json-preview {
  width: 100%;
  min-height: 320px;
  padding: 16px;
  border: 1px solid var(--line);
  color: var(--text);
  font: 0.9rem/1.45 Consolas, "Courier New", monospace;
  background: rgba(0, 0, 0, 0.68);
  resize: vertical;
}

.site-footer {
  width: min(calc(100% - 32px), var(--max));
  margin: 0 auto;
  padding: clamp(42px, 7vw, 78px) 0 clamp(34px, 6vw, 58px);
  color: var(--muted);
  text-align: center;
}

.footer-copy,
.footer-tagline {
  margin: 0;
}

.footer-copy {
  font-size: clamp(0.95rem, 2vw, 1.08rem);
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(18px, 4vw, 28px);
  margin-top: 24px;
}

.footer-nav a {
  color: var(--text);
  font-size: clamp(0.95rem, 2vw, 1.12rem);
  font-weight: 800;
  letter-spacing: 0;
  text-decoration: none;
  text-transform: uppercase;
}

.footer-nav a:hover {
  color: var(--muted);
}

.footer-rule {
  width: 52px;
  height: 1px;
  margin: 46px auto 24px;
  background: var(--line);
}

.footer-tagline {
  font-size: clamp(0.95rem, 2vw, 1.05rem);
}

body[data-widget="compact"] {
  min-height: auto;
  background: transparent;
}

body[data-widget="compact"]::before {
  display: none;
}

body[data-widget="compact"] .widget-main {
  width: 100%;
  margin: 0;
  padding: clamp(12px, 2.8vw, 24px);
}

body[data-widget="compact"] .widget-shell {
  margin: 0;
}

body[data-widget="compact"] .widget-count {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

body[data-widget="compact"] .show-card {
  grid-template-columns: minmax(74px, max-content) minmax(260px, 680px) auto;
  justify-content: start;
  min-height: 112px;
  padding: clamp(15px, 2.4vw, 22px);
  gap: clamp(14px, 3vw, 26px);
}

body[data-widget="compact"] .show-day {
  font-size: clamp(2rem, 4vw, 2.8rem);
}

body[data-widget="compact"] .show-venue {
  font-size: clamp(1rem, 2.1vw, 1.35rem);
}

body[data-widget="compact"] .show-location {
  font-size: clamp(0.86rem, 1.7vw, 1.05rem);
}

body[data-widget="compact"] .button {
  min-width: 104px;
}

body[data-widget="compact"] .show-actions {
  grid-column: 3;
  align-self: center;
  justify-content: flex-start;
  margin-top: 0;
}

body[data-widget="compact"] .widget-footer {
  display: flex;
  justify-content: center;
  margin-top: 18px;
  padding-top: 6px;
}

body[data-widget="compact"] .widget-footer[hidden] {
  display: none;
}

body[data-widget="compact"] .widget-all-link {
  min-width: min(100%, 220px);
}

@media (max-width: 760px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-nav {
    width: 100%;
    align-items: stretch;
  }

  .site-nav a {
    flex: 1;
  }

  .site-nav a {
    padding-inline: 8px;
    font-size: 0.72rem;
  }

  .site-main {
    padding-top: 12px;
  }

  .intro {
    min-height: clamp(150px, 24vh, 230px);
    padding: 8px 0 12px;
  }

  .show-card {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: 12px 14px;
    min-height: 0;
    padding: 16px;
  }

  .year-summary {
    min-height: 46px;
    padding: 0 12px;
  }

  .year-shows {
    gap: 8px;
    padding: 0 8px 8px;
  }

  .show-date {
    grid-row: 1;
    grid-column: 1;
    min-width: 54px;
    padding: 0 12px 0 0;
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .show-day {
    font-size: 2.25rem;
  }

  .show-month,
  .show-year {
    font-size: 0.68rem;
  }

  .show-details {
    grid-row: 1;
    grid-column: 2;
    min-width: 0;
  }

  .show-title-row {
    align-items: start;
    gap: 8px;
  }

  .show-location {
    font-size: 0.86rem;
  }

  .show-venue {
    margin: 0 0 5px;
    font-size: 1rem;
  }

  .show-time,
  .show-lineup,
  .show-notes {
    font-size: 0.84rem;
  }

  .show-lineup,
  .show-notes {
    margin-top: 4px;
  }

  .show-age {
    justify-content: flex-end;
  }

  .show-actions {
    grid-row: 2;
    grid-column: 1 / -1;
    justify-content: stretch;
    gap: 6px;
    margin-top: 4px;
  }

  .button {
    flex: 1;
    min-height: 34px;
    min-width: 0;
    padding: 0 10px;
    font-size: 0.68rem;
  }

  .button--primary {
    flex-basis: 100%;
  }

  .age-image-badge {
    width: 52px;
  }

  .age-text-badge {
    min-width: 48px;
    min-height: 32px;
    padding: 0 8px;
    font-size: 0.76rem;
  }

  .show-status {
    margin-bottom: 6px;
    font-size: 0.66rem;
  }

  .upload-grid {
    grid-template-columns: 1fr;
  }

  .site-footer {
    padding-top: 36px;
  }

  .footer-nav {
    gap: 18px;
    margin-top: 18px;
  }

  .footer-rule {
    margin: 32px auto 18px;
  }

  body[data-widget="compact"] .show-card {
    grid-template-columns: auto minmax(0, 1fr);
    min-height: 0;
    padding: 16px;
  }

  body[data-widget="compact"] .show-actions {
    grid-column: 1 / -1;
    margin-top: 4px;
  }

  body[data-widget="compact"] .widget-all-link {
    width: 100%;
  }
}

@media (prefers-reduced-data: reduce) {
  .background-video {
    display: none;
  }

  body::before {
    z-index: -2;
    background:
      linear-gradient(180deg, rgba(0, 0, 0, 0.46), rgba(0, 0, 0, 0.88) 58%, #020202),
      url("assets/oathbound-video-poster.png") center 22vh / min(560px, 86vw) auto no-repeat,
      #020202;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }

  .background-video {
    display: none;
  }
}
