:root {
  --bg: #f6f7f2;
  --surface: #ffffff;
  --surface-2: #eef3f0;
  --text: #17211d;
  --muted: #64716b;
  --line: #dfe5df;
  --primary: #1d6f5b;
  --primary-dark: #12493c;
  --accent: #d75d3f;
  --warning: #a86411;
  --shadow: 0 18px 40px rgba(35, 51, 43, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.5;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(223, 229, 223, 0.9);
  background: rgba(246, 247, 242, 0.9);
  backdrop-filter: blur(16px);
}

.header-inner,
.section-wrap,
.site-footer {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  color: var(--text);
  font-weight: 800;
  font-size: 18px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), #f0a33a);
  box-shadow: 0 8px 20px rgba(29, 111, 91, 0.18);
  color: #fff;
  flex: 0 0 36px;
}

.brand-mark svg {
  width: 28px;
  height: 28px;
  display: block;
}

.brand-ticket {
  fill: rgba(255, 255, 255, 0.94);
}

.brand-spark,
.brand-dash {
  fill: none;
  stroke: var(--primary);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.brand-spark-main {
  stroke: #d84b3f;
}

.brand-dash {
  stroke-dasharray: 1.4 3;
}

.top-nav {
  display: flex;
  gap: 8px;
}

.top-nav button,
.text-button,
.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 38px;
  padding: 0 14px;
}

.top-nav button:hover,
.text-button:hover,
.secondary:hover {
  border-color: var(--primary);
  color: var(--primary-dark);
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.hero {
  min-height: 420px;
  display: flex;
  align-items: center;
  background:
    linear-gradient(90deg, rgba(9, 24, 19, 0.74), rgba(9, 24, 19, 0.26)),
    url("https://images.unsplash.com/photo-1533174072545-7a4b6ad7a6c3?auto=format&fit=crop&w=1800&q=80")
      center/cover;
}

.hero-content {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  color: #fff;
  padding: 56px 0 72px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-weight: 800;
  font-size: 13px;
}

.hero .eyebrow {
  color: #ffd0c3;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

.hero h1,
.page-head h1 {
  margin: 0;
  max-width: 760px;
  font-size: 42px;
  line-height: 1.12;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 620px;
  margin: 18px 0 28px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 18px;
}

.hero-search {
  display: flex;
  width: min(680px, 100%);
  background: #fff;
  border-radius: 8px;
  padding: 6px;
  box-shadow: var(--shadow);
}

.hero-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  padding: 0 14px;
  outline: 0;
}

.hero-search button,
.filters button {
  min-height: 44px;
  border-radius: 8px;
  padding: 0 18px;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
}

.section-wrap {
  margin-top: 36px;
}

.section-title,
.list-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-title h2 {
  margin: 0;
  font-size: 26px;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}

.quick-card {
  min-height: 92px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(35, 51, 43, 0.06);
}

.quick-card:hover {
  border-color: var(--primary);
}

.event-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.event-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 12px 26px rgba(35, 51, 43, 0.07);
}

.favorite-button {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  min-height: 34px;
  border-radius: 8px;
  padding: 0 11px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--primary-dark);
  border: 1px solid rgba(223, 229, 223, 0.9);
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(35, 51, 43, 0.14);
}

.favorite-button.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.event-card-button {
  width: 100%;
  height: 100%;
  padding: 0;
  text-align: left;
  background: transparent;
  color: inherit;
}

.event-card .favorite-button {
  width: auto;
  height: auto;
}

.event-image {
  aspect-ratio: 16 / 10;
  background: var(--surface-2);
  overflow: hidden;
}

.event-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.event-body {
  padding: 16px;
}

.event-meta,
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 10px;
  background: var(--surface-2);
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 800;
}

.badge.status-ended {
  color: #7b4035;
  background: #f8dfd8;
}

.badge.status-active {
  color: #0f5d49;
  background: #dff3eb;
}

.badge.status-upcoming {
  color: #74500c;
  background: #faedcf;
}

.event-body h3 {
  margin: 0 0 10px;
  font-size: 19px;
  line-height: 1.28;
}

.event-body p {
  margin: 0;
  color: var(--muted);
}

.card-subline {
  margin-top: 4px !important;
  font-size: 13px;
}

.live-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.reason-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.reason-row span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 8px;
  padding: 0 9px;
  background: #f4efe6;
  color: #6d5a36;
  font-size: 12px;
  font-weight: 800;
}

.live-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 8px;
  padding: 0 9px;
  background: #edf5f8;
  color: #1c5665;
  font-size: 12px;
  font-weight: 800;
}

.live-chip.live-calm {
  background: #e4f4ea;
  color: #1c6746;
}

.live-chip.live-normal {
  background: #fbefcf;
  color: #74500c;
}

.live-chip.live-busy {
  background: #f8dfd8;
  color: #7b4035;
}

.page-head {
  padding-top: 34px;
}

.filters {
  display: grid;
  grid-template-columns: 2fr repeat(5, 1fr);
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  min-height: 42px;
  padding: 0 12px;
}

textarea {
  padding: 10px 12px;
  resize: vertical;
}

.list-toolbar select {
  width: auto;
}

.toolbar-note {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.empty-state {
  display: none;
  padding: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  text-align: center;
}

.empty-state.is-visible {
  display: block;
}

.detail {
  margin-top: 34px;
  margin-bottom: 56px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.detail-hero {
  display: grid;
  grid-template-columns: minmax(360px, 0.95fr) minmax(420px, 1.05fr);
}

.detail-hero img {
  width: 100%;
  height: 100%;
  min-height: 360px;
  object-fit: cover;
  display: block;
}

.detail-main {
  padding: 28px;
}

.detail-main h1 {
  margin: 0 0 14px;
  font-size: 34px;
  line-height: 1.16;
}

.detail-subtitle {
  margin: -4px 0 12px;
  color: var(--muted);
  font-weight: 700;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 24px 0;
}

.detail-summary-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
}

.detail-grid-compact {
  margin: 0 0 12px;
}

.detail-section {
  margin-top: 24px;
}

.detail-section h2 {
  margin: 0 0 12px;
  font-size: 20px;
}

.detail-section .detail-grid {
  margin-top: 0;
}

.detail-section > .info-box + .info-box {
  margin-top: 12px;
}

.detail-source {
  color: var(--muted);
}

.live-detail-grid {
  margin-top: 0;
}

.info-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.info-box span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.info-box strong {
  display: block;
  margin-top: 4px;
}

.info-box small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.detail-notice {
  margin-top: 12px;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.detail-actions a,
.detail-actions button {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  border-radius: 8px;
  padding: 0 14px;
  background: var(--primary);
  color: #fff;
  text-decoration: none;
  font-weight: 800;
}

.detail-actions button {
  background: var(--surface-2);
  color: var(--primary-dark);
}

.muted {
  color: var(--muted);
}

.is-hidden {
  display: none;
}

.wide {
  grid-column: 1 / -1;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 36px 0;
  margin-top: 48px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

@media (max-width: 900px) {
  .event-grid,
  .quick-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .filters {
    grid-template-columns: repeat(2, 1fr);
  }

  .detail-hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .header-inner {
    align-items: flex-start;
    flex-direction: column;
    padding: 12px 0;
  }

  .top-nav {
    width: 100%;
  }

  .top-nav button {
    flex: 1;
    padding: 0 8px;
  }

  .hero {
    min-height: 460px;
  }

  .hero h1,
  .page-head h1 {
    font-size: 34px;
  }

  .hero-search {
    flex-direction: column;
  }

  .hero-search input {
    min-height: 44px;
  }

  .event-grid,
  .quick-grid,
  .filters,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .section-title,
  .list-toolbar,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .list-toolbar select {
    width: 100%;
  }
}
