/* === Timeline visualization === */

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

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

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

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

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

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

.timeline__legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

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

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

/* Container */
.timeline-wrap {
  max-width: var(--content-max-width);
  overflow-x: auto;
  margin-bottom: 24px;
  border-radius: 8px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
}

.timeline {
  position: relative;
  height: 420px;
  min-width: 1000px;
}

/* Axis */
.timeline__axis {
  position: absolute;
  top: 200px;
  left: 40px;
  right: 40px;
  height: 3px;
  background: color-mix(in srgb, var(--team-primary) 50%, var(--color-border));
  border-radius: 2px;
}

/* Month grid */
.timeline__month-tick {
  position: absolute;
  top: 50px;
  width: 1px;
  height: 320px;
  background: var(--color-border);
  opacity: 0.5;
}

.timeline__month-label {
  position: absolute;
  top: 30px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-faint);
  transform: translateX(-50%);
}

/* Game dots */
.timeline__dot {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition: all 0.15s;
  z-index: 5;
}

.timeline__dot:hover {
  transform: translate(-50%, -50%) scale(1.6);
  z-index: 20;
}

.timeline__dot--home {
  background: var(--color-home);
  box-shadow: 0 0 6px var(--color-home-faint);
}

.timeline__dot--home:hover {
  box-shadow: 0 0 18px color-mix(in srgb, var(--color-home) 80%, transparent);
}

.timeline__dot--away {
  background: var(--color-away);
  box-shadow: 0 0 6px var(--color-away-faint);
}

.timeline__dot--away:hover {
  box-shadow: 0 0 18px color-mix(in srgb, var(--color-away) 80%, transparent);
}

.timeline__dot--playoff {
  background: var(--color-playoff);
  box-shadow: 0 0 6px var(--color-playoff-faint);
}

.timeline__dot--playoff:hover {
  box-shadow: 0 0 18px color-mix(in srgb, var(--color-playoff) 80%, transparent);
}

.timeline__dot:focus-visible {
  transform: translate(-50%, -50%) scale(1.6);
  z-index: 20;
  outline: 2px solid var(--color-text);
  outline-offset: 2px;
}

/* Result shapes (applied alongside --home/--away) */
.timeline__dot--win {
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
  border-radius: 0;
  opacity: 0.75;
}

.timeline__dot--loss {
  clip-path: polygon(0% 0%, 100% 0%, 50% 100%);
  border-radius: 0;
  opacity: 0.75;
}

.timeline__dot--draw {
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
  border-radius: 0;
  opacity: 0.75;
}

.timeline__dot--scheduled {
  opacity: 0.25;
}

.timeline__dot--win:hover,
.timeline__dot--loss:hover,
.timeline__dot--draw:hover {
  transform: translate(-50%, -50%) scale(1.4);
}

/* Stems */
.timeline__stem {
  position: absolute;
  width: 1px;
}

.timeline__stem--home {
  background: color-mix(in srgb, var(--color-home) 30%, transparent);
}

.timeline__stem--away {
  background: color-mix(in srgb, var(--color-away) 30%, transparent);
}

/* Opponent mini-labels */
.timeline__opp-label {
  position: absolute;
  font-size: 10px;
  font-weight: 700;
  z-index: 6;
  letter-spacing: 0.02em;
  transform: translateX(-50%);
  pointer-events: none;
}

.timeline__opp-label--home {
  color: color-mix(in srgb, var(--color-home) 85%, transparent);
}

.timeline__opp-label--away {
  color: color-mix(in srgb, var(--color-away) 85%, transparent);
}

.timeline__opp-label--playoff {
  color: color-mix(in srgb, var(--color-playoff) 85%, transparent);
}

/* Gap brackets */
.timeline__gap-bracket {
  position: absolute;
  height: 10px;
}

.timeline__gap-bracket--home {
  border-left: 1px solid color-mix(in srgb, var(--color-home) 15%, transparent);
  border-right: 1px solid color-mix(in srgb, var(--color-home) 15%, transparent);
  border-top: 1px solid color-mix(in srgb, var(--color-home) 15%, transparent);
}

.timeline__gap-bracket--away {
  border-left: 1px solid color-mix(in srgb, var(--color-away) 15%, transparent);
  border-right: 1px solid color-mix(in srgb, var(--color-away) 15%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--color-away) 15%, transparent);
}

/* Gap day annotations */
.timeline__gap-label {
  position: absolute;
  font-size: 10px;
  text-align: center;
  transform: translateX(-50%);
  pointer-events: none;
}

.timeline__gap-label--home {
  color: color-mix(in srgb, var(--color-home) 40%, transparent);
}

.timeline__gap-label--away {
  color: color-mix(in srgb, var(--color-away) 40%, transparent);
}

.timeline__gap-label--long {
  font-weight: 700;
}

.timeline__gap-label--long.timeline__gap-label--home {
  color: color-mix(in srgb, var(--color-home) 70%, transparent);
}

.timeline__gap-label--long.timeline__gap-label--away {
  color: color-mix(in srgb, var(--color-away) 70%, transparent);
}

/* Break zone */
.timeline__break {
  position: absolute;
  top: 50px;
  height: 320px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--color-playoff) 5%, transparent), transparent);
  border-left: 1px dashed color-mix(in srgb, var(--color-playoff) 25%, transparent);
  border-right: 1px dashed color-mix(in srgb, var(--color-playoff) 25%, transparent);
  pointer-events: none;
}

.timeline__break-label {
  position: absolute;
  font-size: 12px;
  font-style: italic;
  color: color-mix(in srgb, var(--color-playoff) 50%, transparent);
  transform: translateX(-50%);
  cursor: help;
}

/* Tooltip */
.timeline__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;
}

.timeline__tooltip--visible {
  opacity: 1;
}

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

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

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

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

.timeline__tt-header--playoff {
  background: color-mix(in srgb, var(--color-playoff) 15%, transparent);
  color: var(--color-playoff);
  display: flex;
  align-items: center;
  gap: 6px;
}

.timeline__tt-header--density {
  display: flex;
  align-items: center;
  gap: 6px;
}

.timeline__tt-body {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
}

.timeline__tt-text {
  flex: 1;
}

.timeline__tt-opp {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text);
}

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

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

.timeline__tt-score {
  font-weight: 600;
  color: var(--color-text);
  text-align: center;
  padding: 6px 0 2px;
  font-size: 14px;
  letter-spacing: 0.05em;
}

.timeline__tt-venue {
  font-size: 12px;
  color: var(--color-text-faint);
}

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

.timeline__tt-gap {
  padding: 6px 14px 8px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--color-text-faint);
  border-top: 1px solid var(--color-border);
}

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

.timeline__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;
}

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

.timeline__summary-value--home { color: var(--color-home); }
.timeline__summary-value--away { color: var(--color-away); }

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

/* === Density Strip Bars (all-teams mode) === */
.timeline__bar {
  position: absolute;
  border-radius: 3px 3px 0 0;
  cursor: pointer;
  transform: translateX(-50%);
  transition: opacity 0.15s, box-shadow 0.15s;
  z-index: 5;
}

.timeline__bar:hover,
.timeline__bar:focus {
  opacity: 0.85;
  box-shadow: 0 0 12px currentcolor;
  z-index: 20;
  outline: none;
}

.timeline__bar--playoff {
  background: var(--color-playoff);
}

.timeline__tt-game {
  padding: 4px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--color-border);
}

.timeline__tt-game:last-child {
  border-bottom: none;
}

.timeline__tt-team-logo {
  width: 16px;
  height: 16px;
  object-fit: contain;
  vertical-align: middle;
  margin-right: 4px;
}

