* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

html, body {
  height: 100dvh;
  overflow: hidden;
  background: #1a1a1a;
  color: #fff;
  font-family: 'Google Sans Code', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

#archive-app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  padding: calc(16px + env(safe-area-inset-top))
           calc(16px + env(safe-area-inset-right))
           calc(16px + env(safe-area-inset-bottom))
           calc(16px + env(safe-area-inset-left));
}

#archive-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

#back-btn {
  padding: 6px 12px;
  border-radius: 6px;
  border: 1.5px solid #555;
  background: transparent;
  color: #888;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
}

#back-btn:active { background: #333; }

#archive-header h1 {
  font-size: 18px;
  font-weight: 600;
  color: #ccc;
}

#month-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 16px;
}

.month-arrow {
  padding: 6px 12px;
  border-radius: 6px;
  border: 1.5px solid #555;
  background: transparent;
  color: #888;
  font-size: 18px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  line-height: 1;
}

.month-arrow:active { background: #333; }
.month-arrow:disabled { opacity: 0.3; cursor: default; }

#month-label {
  font-size: 16px;
  font-weight: 600;
  color: #ccc;
  min-width: 140px;
  text-align: center;
}

#calendar {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

#day-headers {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 6px;
}

.day-header {
  text-align: center;
  font-size: 12px;
  color: #666;
  font-weight: 600;
  padding: 4px 0;
}

#day-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.day-cell {
  aspect-ratio: 1;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
  background: #2a2a2a;
  gap: 2px;
  position: relative;
}

.day-cell.empty {
  background: transparent;
  cursor: default;
}

.day-cell.no-puzzle {
  background: #222;
  cursor: default;
}

.day-cell .day-num {
  font-weight: 600;
  color: #555;
  font-size: 13px;
}

.day-cell.has-puzzle .day-num {
  color: #888;
}

.day-cell.attempted .day-num {
  color: #666;
}

.day-cell.won {
  background: #2a3a2a;
}

.day-cell.won .day-num {
  color: #aaa;
}

.day-cell .day-detail {
  font-size: 9px;
  color: #888;
  font-weight: 600;
}

.day-cell.fc {
  background: #3a3520;
}

.day-cell.fc .day-detail {
  color: #f0c040;
}

.day-cell.perfect {
  background: #3a3520;
}

.day-cell .star {
  font-size: 18px;
  line-height: 1;
}
