/* Archive page styles - mobile-first */

.header-link {
  color: inherit;
  text-decoration: none;
}

.header-link:hover {
  text-decoration: underline;
}

#archive-container {
  max-width: 350px;
  margin: 0 auto;
  padding: 0 8px;
}

.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-dim);
}

.no-puzzles {
  text-align: center;
  padding: 40px;
  color: var(--text-dim);
}

/* Overall stats section */
.archive-overall-stats {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.archive-overall-stats .progress-bar {
  width: 120px;
  flex: none;
}

.archive-overall-stats .progress-label {
  min-width: auto;
}

/* Progress bar */
.progress-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.progress-bar {
  flex: 1;
  height: 8px;
  background: var(--border-color);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--lower);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.progress-container.complete .progress-fill {
  background: var(--correct);
}

.progress-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  white-space: nowrap;
  min-width: 100px;
  text-align: right;
}

.archive-month {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

.archive-month-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.archive-month-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.archive-month-header .progress-container {
  flex: 1;
  max-width: 160px;
}

.archive-month-header .progress-bar {
  height: 6px;
}

.archive-month-header .progress-label {
  font-size: 0.7rem;
  min-width: 80px;
}

.archive-calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.archive-weekday {
  text-align: center;
  font-size: 0.7rem;
  color: var(--text-dim);
  padding: 4px 0;
  font-weight: 500;
}

.archive-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 0.85rem;
  text-decoration: none;
  color: var(--text-primary);
  transition: transform 0.15s, background-color 0.15s;
  min-height: 40px;
}

.archive-day:hover:not(.empty):not(.future):not(.no-puzzle) {
  transform: scale(1.05);
}

.archive-day.empty {
  background: transparent;
  pointer-events: none;
}

.archive-day.future {
  background: var(--card-bg);
  color: var(--text-dim);
  pointer-events: none;
  opacity: 0.3;
}

.archive-day.no-puzzle {
  background: var(--card-bg);
  color: var(--text-dim);
  pointer-events: none;
  opacity: 0.4;
}

.archive-day.unplayed {
  background: var(--card-bg);
  border: 2px solid var(--accent);
  color: var(--text-primary);
}

.archive-day.unplayed:hover {
  background: var(--accent);
  color: white;
}

.archive-day.played {
  position: relative;
}

.archive-day.played.won {
  background: var(--correct);
  color: white;
}

.archive-day.played.lost {
  background: var(--wrong);
  color: white;
}

.archive-day-number {
  font-weight: 600;
  line-height: 1;
}

.archive-day-result {
  font-size: 0.6rem;
  opacity: 0.9;
  line-height: 1;
  margin-top: 2px;
}

.archive-footer {
  margin-top: 24px;
  margin-bottom: 32px;
  text-align: center;
}

.archive-footer .btn-primary {
  display: inline-block;
  width: auto;
  padding: 12px 32px;
}

/* Slightly larger on bigger screens */
@media (min-width: 400px) {
  #archive-container {
    max-width: 380px;
  }

  .archive-day {
    min-height: 44px;
    font-size: 0.9rem;
  }

  .archive-day-result {
    font-size: 0.65rem;
  }
}
