/* === Monthly visualization === */

.monthly__header {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 20px;
}

.monthly__crest {
  width: 80px;
  height: 80px;
  object-fit: contain;
  flex-shrink: 0;
}

.monthly__title {
  font-size: 22px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 4px;
}

.monthly__subtitle {
  font-size: 14px;
  color: var(--color-text-muted);
  margin-bottom: 12px;
}

/* Legend */
.monthly__legend {
  display: flex;
  gap: 20px;
}

.monthly__legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--color-text-muted);
}

.monthly__legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.monthly__legend-dot--home { background: var(--color-home); }
.monthly__legend-dot--away { background: var(--color-away); }

.monthly__legend-label--home { color: var(--color-home); }
.monthly__legend-label--away { color: var(--color-away); }

/* Chart container */
.monthly__chart-wrap {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 24px;
}

.monthly__chart {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 16px;
  height: 300px;
  position: relative;
}

/* Individual bar group (column + label) */
.monthly__bar-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  max-width: 100px;
  height: 100%;
  justify-content: flex-end;
}

/* The stacked bar column */
.monthly__bar-col {
  display: flex;
  flex-direction: column-reverse;
  width: 100%;
  border-radius: 4px 4px 0 0;
  overflow: hidden;
}

/* Individual bar segment */
.monthly__bar-segment {
  width: 100%;
  transition: opacity 0.15s;
  cursor: pointer;
  min-height: 1px;
}

.monthly__bar-segment--home {
  background: var(--color-home);
}

.monthly__bar-segment--away {
  background: var(--color-away);
}

.monthly__bar-segment:hover,
.monthly__bar-segment:focus-visible {
  opacity: 0.8;
}

.monthly__bar-segment:focus-visible {
  outline: 2px solid var(--color-text);
  outline-offset: -2px;
}

/* Count label above bar */
.monthly__bar-count {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text-muted);
  margin-bottom: 6px;
  text-align: center;
}

/* Month label below bar */
.monthly__month-label {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin-top: 10px;
  text-align: center;
}

/* Tooltip */
.monthly__tooltip {
  position: fixed;
  z-index: 1000;
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  max-width: 320px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s;
  box-shadow: 0 8px 24px rgb(0 0 0 / 50%);
  overflow: hidden;
}

.monthly__tooltip--visible {
  opacity: 1;
}

.monthly__tooltip--home { border-color: color-mix(in srgb, var(--color-home) 40%, transparent); }
.monthly__tooltip--away { border-color: color-mix(in srgb, var(--color-away) 40%, transparent); }

.monthly__tt-header {
  padding: 6px 14px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.monthly__tt-header--home {
  background: color-mix(in srgb, var(--color-home) 15%, transparent);
  color: var(--color-home);
}

.monthly__tt-header--away {
  background: color-mix(in srgb, var(--color-away) 15%, transparent);
  color: var(--color-away);
}

.monthly__tt-header--team {
  padding: 6px 14px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
}

.monthly__tt-body {
  padding: 10px 14px;
}

.monthly__tt-match {
  font-size: 12px;
  color: var(--color-text-muted);
  padding: 2px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.monthly__tt-logo {
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex-shrink: 0;
}

.monthly__tt-logo-sm {
  width: 20px;
  height: 20px;
  object-fit: contain;
  flex-shrink: 0;
}

.monthly__tt-match-date {
  color: var(--color-text-faint);
}

/* Summary bar */
.monthly__summary {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

.monthly__summary-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 10px 16px;
  text-align: center;
  flex: 1;
  min-width: 120px;
}

.monthly__summary-value {
  font-size: 20px;
  font-weight: 700;
}

.monthly__summary-value--home { color: var(--color-home); }
.monthly__summary-value--away { color: var(--color-away); }
.monthly__summary-value--neutral { color: var(--color-text); }

.monthly__summary-label {
  font-size: 12px;
  color: var(--color-text-muted);
}
