body {
  margin: 0;
  font-family: 'Segoe UI', Arial, sans-serif;
  background: #fafbfc;
  color: #222;
}
#root {
  margin: 0 auto;
  padding: 24px 24px;
  max-width: 1500px;
}
.season-selector {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.season-button {
  padding: 10px 20px;
  background: #fff;
  border: 2px solid #ddd;
  border-radius: 10px;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  color: #444;
}
.season-button:hover {
  border-color: #1976d2;
  background: #f5f9ff;
}
.season-button.active {
  background: #1976d2;
  border-color: #1976d2;
  color: #fff;
}
@media (max-width: 600px) {
  .season-selector {
    gap: 8px;
  }
  .season-button {
    padding: 8px 16px;
    font-size: 0.95em;
  }
}
.calendar-layout-row {
  display: flex;
  flex-direction: row;
  gap: 32px;
  margin-bottom: 32px;
  justify-content: center;
}

.calendar-layout-row:last-child {
  margin-bottom: 0;
}
@media (max-width: 900px) {
  .calendar-layout-row {
    flex-wrap: wrap;
    gap: 18px;
    margin-bottom: 18px;
  }
  .month-calendar {
    min-width: 240px;
    max-width: 99vw;
  }
}
.month-calendar {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px #0001;
  padding: 10px 10px 6px 10px;
  flex-basis: 340px;
  flex-grow: 1;
  flex-shrink: 1;
  min-width: 0;
  max-width: 100%;
  display: flex;
  flex-direction: column;
}
.month-title {
  font-size: 1.2em;
  font-weight: 600;
  margin-bottom: 10px;
  letter-spacing: 0.5px;
}
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.day-header {
  font-size: 0.95em;
  font-weight: 500;
  text-align: center;
  color: #888;
  padding: 4px 0;
}
.day-cell {
  min-height: 32px;
  height: 32px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border-radius: 6px;
  position: relative;
  font-size: 1em;
  transition: background 0.15s;
  cursor: pointer;
}

.custom-tooltip {
  position: fixed;
  z-index: 9999;
  width: fit-content;
  background: #fff;
  color: #222;
  box-shadow: 0 6px 24px #0002, 0 1.5px 5px #0001;
  border-radius: 10px;
  padding: 12px 16px 10px 14px;
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  font-size: 1em;
  pointer-events: none;
  opacity: 0;
  transform: translateY(8px) scale(0.98);
  transform-origin: top left;
  transition: opacity 0.18s, transform 0.18s;
  line-height: 1.4;
}

@media (min-width: 901px) {
  .custom-tooltip {
    font-size: 0.93em;
  }
}
.custom-tooltip.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.custom-tooltip .tt-title {
  width: 100%;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 1.08em;
  text-align: left;
}
.custom-tooltip .tt-event {
  width: 100%;
  margin-bottom: 2px;
  font-size: 0.98em;
}
.custom-tooltip .tt-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}
.custom-tooltip .tt-champ {
  font-weight: 500;
  margin-right: 2px;
}



.day-cell.has-event {
  background: #f5faff;
}
.event-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-left: 3px;
  vertical-align: middle;
}
.event-list {
  margin-top: 4px;
  text-align: left;
}
.event-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.93em;
  margin-bottom: 2px;
  padding-left: 2px;
}
.event-label {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
/* Основной контейнер */
.calendar-container {
  display: flex;
  gap: 32px;
}

/* Контейнер с календарями */
.calendars-wrapper {
  flex: 1;
}

/* Блок фильтров */
.filters-wrapper {
  position: sticky;
  top: 24px;
  min-width: min-content;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  z-index: 1000;
}

.filters {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px #0001;
  padding: 12px;
  height: 100%;
  box-sizing: border-box;
}

.filters h3 {
  margin: 0 0 6px 0;
  font-size: 1.05em;
  font-weight: 600;
}

.filter-group + .filter-group {
  margin-top: 16px;
}

.filter-toggle {
  display: none;
  position: fixed;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.6);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  z-index: 1001;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.filter-toggle svg {
  width: 24px;
  height: 24px;
  fill: #444;
}
.filter-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  padding: 0;
  background: #e53935;
  color: #fff;
  border-radius: 50%;
  font-size: 0.97em;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 18px;
  box-shadow: 0 1px 4px #0002;
  z-index: 2;
  pointer-events: none;
}

.filter-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 999;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

@media (max-width: 1200px) {
  .calendar-container {
    position: relative;
  }

  .filters-wrapper {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: fit-content;
    min-width: min-content;
    max-width: min(90vw, 400px);
    background: #fff;
    padding: 24px 16px;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    transition: transform 0.3s ease-out;
    overflow-y: auto;
  }

  .filters {
    height: auto;
    min-height: 100%;
    padding-top: 40px;
  }

  .filters-wrapper.visible {
    display: block;
    transform: translateX(0);
  }

  .filter-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .filter-overlay.visible {
    display: block;
  }
}
.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
}
.filter-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border-radius: 8px;
  background: #f4f6fa;
  border: 1.5px solid #bbb;
  font-size: 0.92em;
  cursor: pointer;
  transition: background 0.15s, border 0.15s;
  user-select: none;
  white-space: nowrap;
  position: relative;
}

.filter-label .legend-dot {
  margin-right: 3px;
  flex-shrink: 0;
  width: 11px;
  height: 11px;
}
.filter-label .filter-count {
  font-size: 0.9em;
  color: #888;
  font-weight: 400;
  margin-left: 2px;
  vertical-align: middle;
  flex-shrink: 0;
}
.filter-label input[type="checkbox"] {
  accent-color: #1976d2;
  margin-right: 0px;
  display: none;
}
.filter-label .legend-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 5px;
}
.filter-label.selected {
  background: #e3f2fd;
  border-color: #1976d2;
}

@media (max-width: 900px) {
  .calendar-container {
    flex-direction: column;
    align-items: center;
  }
  .month-calendar {
    max-width: 98vw;
    min-width: 0;
    padding: 12px 8px 8px 8px;
  }
  .custom-tooltip {
    position: fixed;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    top: auto !important;
    width: 100% !important;
    max-width: 100vw !important;
    min-width: 0;
    transform-origin: bottom center;
    border-radius: 16px 16px 0 0;
    padding: 16px 16px 24px 16px;
    box-shadow: 0 -2px 24px rgba(0, 0, 0, 0.15);
    box-sizing: border-box;
    word-break: break-word;
    overflow-wrap: break-word;
  }
  .custom-tooltip .tt-title {
    width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    white-space: normal !important;
    text-align: left;
    max-width: 100vw;
  }
  .custom-tooltip .tt-event {
    width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
  }
  .custom-tooltip .tt-champ {
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
  }
  .custom-tooltip.visible {
    transform: translateY(0) scale(1);
  }
  .custom-tooltip:not(.visible) {
    transform: translateY(100%) scale(1);
  }
  
  footer { 
    margin-bottom: 16px !important; 
  }
}
@media (max-width: 600px) {
  #root {
    padding: 12px;
  }
  .month-calendar {
    padding: 16px 8px 12px 8px;
  }
  .calendar-container {
    gap: 16px;
  }
  footer {
    margin: 48px 0 32px 0;
  }
}

/* Гарантируем круглую кнопку сброса фильтра */
.filter-reset-badge {
  display: inline-flex !important;
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  min-height: 18px !important;
  max-width: 18px !important;
  max-height: 18px !important;
  border-radius: 50% !important;
  background: #bbb !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  border: none !important;
  vertical-align: middle !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
  line-height: 0 !important;
  text-align: center !important;
}
.filter-reset-badge svg {
  width: 13px !important;
  height: 13px !important;
  display: block !important;
  margin: auto !important;
  position: static !important;
}
.filter-reset-badge svg {
  width: 13px !important;
  height: 13px !important;
  display: block !important;
  margin: 0 auto !important;
}
