:root {
  --bg-deep: #0b0f14;
  --bg-panel: rgba(18, 24, 32, 0.88);
  --bg-panel-solid: #121820;
  --stroke: rgba(255, 255, 255, 0.12);
  --stroke-strong: rgba(255, 255, 255, 0.22);
  --text: #f4f1ea;
  --text-muted: #9aa3ad;
  --accent: #e8b86d;
  --accent-hot: #ff4d3a;
  --info: #38bdf8;
  --ext: #cfcfcf;
  --native: #f87171;
  --radius: 14px;
  --font-display: "Syne", sans-serif;
  --font-body: "IBM Plex Sans", sans-serif;
  --max: 920px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.45;
  background:
    radial-gradient(1200px 600px at 12% -10%, rgba(232, 184, 109, 0.14), transparent 55%),
    radial-gradient(900px 500px at 90% 0%, rgba(56, 189, 248, 0.08), transparent 50%),
    linear-gradient(180deg, #10161e 0%, var(--bg-deep) 40%, #070a0e 100%);
  overflow-x: hidden;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px clamp(16px, 4vw, 40px);
  border-bottom: 1px solid var(--stroke);
  background: rgba(8, 11, 16, 0.78);
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.brand__name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.55rem, 3.2vw, 2rem);
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--text);
}

.brand__name span {
  color: var(--accent);
}

.brand__tag {
  color: var(--text-muted);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.btn {
  appearance: none;
  border: 1px solid var(--stroke-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.85rem;
  padding: 9px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.35);
  text-decoration: none;
}

.btn--accent {
  background: var(--accent);
  border-color: var(--accent);
  color: #1a1206;
  font-weight: 600;
}

.btn--accent:hover {
  background: #f0c789;
  border-color: #f0c789;
  color: #1a1206;
}

.btn.active {
  background: var(--text);
  color: #111;
  border-color: var(--text);
  font-weight: 600;
}

main {
  width: min(100% - 32px, var(--max));
  margin: 28px auto 48px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  flex: 1;
}

.hero {
  display: grid;
  gap: 10px;
}

.hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 4vw, 2.35rem);
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.hero p {
  margin: 0;
  max-width: 42rem;
  color: var(--text-muted);
}

.panel {
  background: var(--bg-panel);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 16px 18px;
  backdrop-filter: blur(10px);
}

.legend {
  display: grid;
  gap: 12px;
}

.legend__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.legend__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.legend-card {
  border: 1px solid var(--stroke);
  border-radius: 10px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.22);
  display: grid;
  gap: 8px;
}

.legend-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 16px;
  padding: 0 5px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  width: fit-content;
}

.badge--info {
  background: rgba(56, 189, 248, 0.18);
  border: 1px solid var(--info);
  color: #bae6fd;
}

.badge--ext {
  background: #cfcfcf;
  border: 1px solid #9e9e9e;
  color: #212121;
}

.badge--native {
  background: rgba(248, 113, 113, 0.16);
  border: 1px solid var(--native);
  color: #fecaca;
}

.filters {
  display: grid;
  gap: 12px;
}

.filters__row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
}

.field {
  display: grid;
  gap: 5px;
  min-width: 140px;
  flex: 1 1 160px;
}

.field label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.field select {
  width: 100%;
  appearance: none;
  background: rgba(0, 0, 0, 0.35)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%239aa3ad' d='M1 1l5 5 5-5'/%3E%3C/svg%3E")
    no-repeat right 12px center;
  color: var(--text);
  border: 1px solid var(--stroke-strong);
  border-radius: 10px;
  padding: 10px 34px 10px 12px;
  font: inherit;
}

.field select:focus {
  outline: 1px solid var(--accent);
  border-color: var(--accent);
}

.status-line {
  color: var(--text-muted);
  font-size: 0.82rem;
  min-height: 1.2em;
}

.status-line.is-error {
  color: #fca5a5;
}

#calendar-panel {
  display: none;
}

#calendar-panel.is-visible {
  display: block;
}

#calendar {
  --fc-border-color: rgba(255, 255, 255, 0.1);
  --fc-page-bg-color: transparent;
  --fc-neutral-bg-color: rgba(255, 255, 255, 0.04);
  --fc-list-event-hover-bg-color: rgba(255, 255, 255, 0.06);
  --fc-button-bg-color: rgba(255, 255, 255, 0.06);
  --fc-button-border-color: rgba(255, 255, 255, 0.18);
  --fc-button-text-color: #f4f1ea;
  --fc-button-hover-bg-color: rgba(255, 255, 255, 0.12);
  --fc-button-hover-border-color: rgba(255, 255, 255, 0.28);
  --fc-button-active-bg-color: #e8b86d;
  --fc-button-active-border-color: #e8b86d;
  --fc-button-active-text-color: #1a1206;
  --fc-today-bg-color: rgba(232, 184, 109, 0.12);
  --fc-event-border-color: transparent;
}

.fc {
  font-family: var(--font-body);
}

.fc .fc-toolbar-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.fc .fc-button {
  border-radius: 8px !important;
  text-transform: capitalize;
  font-weight: 600;
  box-shadow: none !important;
}

.fc .fc-daygrid-day-number,
.fc .fc-col-header-cell-cushion {
  color: var(--text-muted);
  text-decoration: none;
}

.fc-event {
  border-radius: 4px !important;
  font-size: 0.72rem;
  padding: 1px 3px;
  cursor: pointer;
}

.list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.list-toolbar__label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.event-group-header {
  background: rgba(255, 255, 255, 0.04);
  padding: 7px 12px;
  margin-top: 12px;
  font-weight: 700;
  color: var(--accent);
  border-left: 3px solid var(--accent);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.event-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 12px 4px 12px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  align-items: start;
}

.event-card:hover {
  background: rgba(255, 255, 255, 0.03);
}

.event-card__title {
  margin: 0 0 6px;
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.25;
}

.event-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.event-card__cat {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  color: #0b0f14;
}

.event-card__links {
  display: grid;
  gap: 4px;
  justify-items: end;
  font-size: 0.8rem;
  text-align: right;
}

.event-card__links a {
  color: #7dd3fc;
}

.empty-state {
  text-align: center;
  color: #6b7280;
  padding: 28px 12px;
}

.suggest {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.suggest p {
  margin: 0;
  color: var(--text-muted);
  max-width: 36rem;
  font-size: 0.9rem;
}

.site-footer {
  margin-top: auto;
  padding: 18px 16px 28px;
  text-align: center;
  color: #5b6570;
  font-size: 0.75rem;
}

.site-footer a {
  color: #8b949e;
}

@media (max-width: 760px) {
  .legend__grid {
    grid-template-columns: 1fr;
  }

  .event-card {
    grid-template-columns: 1fr;
  }

  .event-card__links {
    justify-items: start;
    text-align: left;
  }

  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }
}
